你可以通过如下方法实现:
setTimeout(() => {
this.customTableHeight = window.innerHeight - this.$refs.table.$el.offsetTop;
}, 100);
然后将customTableHeight绑定到表格组件上:
:height="customTableHeight" ref="table"
当然不要忘记在data中声明该变量。
原文:https://blog.51cto.com/xvjunjie/2539764