vue hasOwnProperty 这个报错 不知道什么意思 能正常启动
// 读取FILE中的数据(变为JSON格式
async handle(ev) {
const file = ev.raw
if (!file) return
let data = await readFile(file)
const workbook = xlsx.read(data, { type: 'binary' })
const worsheet = workbook.Sheets[workbook.SheetNames[0]]
data = xlsx.utils.sheet_to_json(worsheet)
const arr = []
data.forEach(item => {
const obj = {}
for (const key in character) {
// if (!character.hasOwnProperty(obj, 'key')) break
if (!character.hasOwnProperty(key)) break
let v = character[key]
const text = v.text
const type = v.type
v = item[text] || ''
type === 'string' ? (v = String(v)) : null
type === 'string' ? (v = String(v)) : null
obj[key] = v
}
arr.push(obj)
})
this.tempData = arr
},
把这个报错解决
https://blog.csdn.net/qq_36727756/article/details/105464902
Object.prototype.hasOwnProperty.call(character, 'key')