尝试了很多方法都不行,最后结合两个up主的答案配合起来
先加上这两个样式
.el-table__fixed-right{
height: 100% !important;
}
.el-table__fixed-body-wrapper {
max-height: 100% !important
}
然后在用watch监视tabledata,调用
doLayout()方法
.el-table__fixed-right{
height: 100% !important;
}
.el-table__fixed-body-wrapper {
max-height: 100% !important
}
watch: {
tableData(val) {
if (val) {
this.$nextTick(() => {
this.$refs.multipleTable.doLayout()
})
}
}
},