elementui 中 table 默认勾选某些项

获取表格数据列表后,对已选中的项做默认选中操作 toggleRowSelection 方法,两个参数,第一个为list里面的item项,第二个设置为true即可。

this.listData.forEach(item => {
    if (item.is_selected === 1) {
        this.$refs.tableName.toggleRowSelection(item, true);
        list.push(item);
    }
});
发布了4 篇原创文章 · 获赞 1 · 访问量 43

猜你喜欢

转载自blog.csdn.net/qq_33864480/article/details/105266888