nuxt3+elementPlus使用el-table组件无法读取row
<el-table-column fixed="right">
< template #default="scope">
<span>{{ scope.row.name }}span>
template>
el-table-column>
加上这个{{ scope.row.name }}就报错Cannot read properties of undefined (reading ‘row‘)
不加就正常运行好郁闷什么情况?
对了报错就是在F5刷新才会报错,如果用router跳转又是正常
html上写法写成{{scope && scope.row && scope.row.name}}试试,单从语法方面考虑这么改,没有深究框架
看看 原文件