用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>
慕妹3146593
相关分类