el-table不更新,控制台报错 Cannot read pr
2023-03-10 本文已影响0人
马川敉
看了有些帖子,都没说到点上,但也给了启发
这个报错原因就是 table-column 上绑定的prop对应的值类型为object,把值改为字符串、数值或者布尔类型的就可以了
例如
const data = {
country: {
name: '中国'
}
}
<el-table-column prop="country" label="国家" width="180" />
需要改为
const data = {
country: '中国'
}
<el-table-column prop="country" label="国家" width="180" />
以下附加异常效果和报错
![](https://img.haomeiwen.com/i13918927/a1f431539baa87f7.png)
![](https://img.haomeiwen.com/i13918927/60abf43815c08cbe.png)