const fs = require('fs');
const path = 'D:\\project\\zhizhu\\components\\PhotoUploadForm.vue';
const content = fs.readFileSync(path, 'utf8');
const lines = content.split('\n');

// 检查所有包含 'data' 的行
console.log('=== Lines containing "data" as property declaration ===\n');
for (let i = 0; i < lines.length; i++) {
  if ((lines[i].includes('data()') || lines[i].includes('data ()') || lines[i].match(/\sdata\s*:/))) {
    console.log(`Line ${i + 1}: ${lines[i]}`);
  }
}

// 检查是否有两个 data() 函数
console.log('\n=== Checking for duplicate data() ===\n');
let dataCount = 0;
for (let i = 0; i < lines.length; i++) {
  if (lines[i].match(/\sdata\s*\(\s*\)\s*\{?/)) {
    dataCount++;
    console.log(`Data function #${dataCount} at line ${i + 1}: ${lines[i]}`);
  }
}

// 检查 line 509 附近
console.log('\n=== Lines 505-515 ===');
for (let i = 504; i < 515 && i < lines.length; i++) {
  console.log(`Line ${i + 1}: ${lines[i]}`);
}
