data(){
? return{
? ? listData:[],//當(dāng)前的table的數(shù)據(jù)
? ? hasSelectList:[],//已經(jīng)選擇的id組成的數(shù)組
? }
}
this.$nextTick(()=>{
? this.listData.forEach(row => {
? ? if(this.hasSelectList.indexOf(row.id) >= 0){
? ? ? this.$refs.dataTable.toggleRowSelection(row,true);
? ? }
? })
})