用row-class-name給el-table設置行樣式,數據更新后行樣式渲染混亂,是不是需要用Vue.nextTick()在回調中更新,如果是,動態樣式:row-class-name="tableRowClassName"如何在回調中更新?<el-table :data="tableList" :row-class-name="tableRowClassName">...</el-table><script>
tableRowClassName({row, rowIndex}) { if (row.type === 2) { return 'success-row';
} return '';
},
getList(){
axios.post('/getList', { uid: this.uid
})
.then(function (response) { console.log(response); this.tableList = response.data.dataList
})
.catch(function (error) { console.log(error);
});
}</script>
添加回答
舉報
0/150
提交
取消