element UI 2.15.13和 vue2.0表格勾选回显

弹窗回显勾选的项

关键代码

// 函数名叫什么无所谓,函数的参数值 data是要回显表格的所有数据
// 数据改变放在 this.$nextTick中
handleSelection(data) {
    this.$nextTick(() => {
        // selectedArr 是所有需要勾选的项的集合
        const selectedArr = data.filter(item => item.userId);
        selectedArr.forEach(item => {
            this.$refs.multipleTable.toggleRowSelection(item);
        });
    });
},

完整代码





你可能感兴趣的:(前端vue.js)