分享一个vue table 勾选回显时候的小细节
在el-table-column中使用:reserve-selection="true"来保留首页或其他选中数据时的选中状态
以不留神 就会报错 Vue Error:[ElTable] prop row-key is required
怎么解决呢
在el-table上添加:row-key=“getRowKey”
methods: { getRowKey(row){ return row.id;}, }
注:这里的id 是你回显是用到的一个唯一的值 根据具体情况自己来定
这样就完美解决了