标签:style 需求 htm span center pre nbsp his select
需求:table组件的checkbox进行数据重显,默认显示已选中数据
// html <Table ref="multipleTable" :data="dataArr" > <el-table-column type="selection" align="center"></el-table-column> </Table> // js // table数据 let dataArr = [{name:‘张三‘,id:1},{name:‘李四‘,id:2}]; // 已选数据ID数组 let IDArr = [2]; // 复选 reselectFun(dataArr, IDArr ){ this.$nextTick(function() { dataArr.forEach(row => { if (IDArr.includes(row.id)) { this.$refs.multipleTable.toggleRowSelection(row, true); } }); }); }
标签:style 需求 htm span center pre nbsp his select
原文地址:https://www.cnblogs.com/fengsaoke/p/13299074.html