问题遇到的现象和发生背景
在修改数据后,点击提交,出现TypeError: Cannot read properties of undefined (reading 'result')的错误
问题相关代码,请勿粘贴截图
var imgIds = this.fileList
.map(item => {
// console.log(item);
let fileType = this.matchType(item.response.result.s.fileName)
if(fileType == 'pdf'){
return {
s:item.response.result.s?item.response.result.s.id:null,
see:item.response.result.see?item.response.result.see.arg:null
}
}else{
return false
// return item.response.result.s.id
}
}
).filter(e=>e);
if(imgIds.length > 0){
values.imgIds = JSON.stringify(imgIds);
}
运行结果及报错内容
createBaseForm.js?6c71:617 TypeError: Cannot read properties of undefined (reading 'result')
at eval (ShipUploadPage.vue?a6f6:762)
at Array.map (<anonymous>)
at eval (ShipUploadPage.vue?a6f6:759)
at callback (createBaseForm.js?6c71:583)
at Vue.validateFieldsInternal (createBaseForm.js?6c71:478)
at eval (createBaseForm.js?6c71:610)
at new Promise (<anonymous>)
at Vue.validateFields (createBaseForm.js?6c71:571)
at VueComponent.handleOk (ShipUploadPage.vue?a6f6:746)
at invokeWithErrorHandling (vue.esm.js?efeb:1863)
我的解答思路和尝试过的方法
我想要达到的结果
修改后点击提交,显示修改成功