尝试了很多方法都不行,最后结合两个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()
        })
      }
    }
  },

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐