1、需要增加到table表格里的  :height="tableHeight" ref="table" 

<Table :columns="columns" :data="list" :height="tableHeight" ref="table"></Table>
& nbsp ;

2、在return 定义一个默认高度

return {
      tableHeight: 150
}

3、在mounted中重新赋值 this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160(可根据页面调整),window.innerHeight是浏览器的可用高度,this.$refs.table.$el.offsetTop是表格距离浏览器可用高度顶部的距离

mounted() {
         this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 160
}

 

标签: Node.js, Vue, iview

博主的文章或程序如果给您带来了价值,感谢您打赏一二

添加新评论