ElementUI el-table 动态显示表格的时候,会发生显示错位的情况,拖拽一下又恢复正常了
之前试试了各种css都没有效果
/* 表格错位的问题 */
.working-hours-table {
/deep/.el-table__fixed-body-wrapper{
top:29px !important;
height: calc(100% - 29px) !important;
}
/deep/.el-table__fixed{
height: 100% !important;
}
/deep/ .el-table__fixed-right{
height: 100% !important;
}
}
解决办法:
watch: {
// tableData是el-table绑定的数据
tableData: {
// 解决表格显示错位问题
handler () {
this.$nextTick(() => {
// tableRef是el-table绑定的ref属性值
this.$refs.multipleTable.doLayout() // 对 Table 进行重新布局
})
},
deep: true
}
},