获取表格数据列表后,对已选中的项做默认选中操作 toggleRowSelection 方法,两个参数,第一个为list里面的item项,第二个设置为true即可。
this.listData.forEach(item => {
if (item.is_selected === 1) {
this.$refs.tableName.toggleRowSelection(item, true);
list.push(item);
}
});
获取表格数据列表后,对已选中的项做默认选中操作 toggleRowSelection 方法,两个参数,第一个为list里面的item项,第二个设置为true即可。
this.listData.forEach(item => {
if (item.is_selected === 1) {
this.$refs.tableName.toggleRowSelection(item, true);
list.push(item);
}
});