报错如下:
错误代码:
searchList() { this.entity = {} this.edit = null let query = {} query.traceCode = this.code this.loading = true codeApi.queryTraceCode(query).then(res => { ... }, err => { console.error(err) }).finally(() => { this.loading = false }) },
数据模型:
data() { return { edit: { name: '', prepnSpec: null, pkgSpec: null, expiryTem: null, approvalLicenceNo: null, produceDate: null, expiryDate: null, batchNo: null, produceEntName: null, }, } },
问题原因:将null赋值给对象。
解决办法:
searchList() { this.entity = {} this.edit = {} let query = {} query.traceCode = this.code this.loading = true codeApi.queryTraceCode(query).then(res => { ... }, err => { console.error(err) }).finally(() => { this.loading = false }) },