element 上面两块各个块自适应 屏幕

第一种结合 el-table 的 height属性 高度调样式:
在这里插入图片描述
html布局:
在这里插入图片描述
js:
tableHeight: null,
mounted() {
this.tableHeight = window.innerHeight - this. r e f s . t a b l e . refs.table. refs.table.el.offsetTop - 70; // 这个减 70 是调节范围 可以随意调,来达到下边框里的内容自适应下边整个框
}

css样式:
.one-page-view {
background: #f3f3f3;
padding: 10px;
margin: 0;
min-height: calc(100vh - 20px);

.main-panel {
height: calc(100vh - 180px); // -180px 也是可以调的主要调 这个高度 让下面的el-card 适应剩下的高度 达到能在一屏显示
}
// table 的 滚动条
/deep/ .el-table__body-wrapper::-webkit-scrollbar {
width: 6px;
height: 6px;
}
//滚动条的滑块
/deep/ .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #ddd;
border-radius: 3px;
}

// 滚动条轨道(在el-table 有边框的情况下不设置 height高度时 设置这个可以)
/deep/ .el-table__body-wrapper::-webkit-scrollbar-track {
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 3px;
background-color: rgba(255, 255, 255, 1);
}

第二种:不带el-table 而是自己写的div 布局
在这里插入图片描述
tableHeight: null,

mounted() {
this.tableHeight = window.innerHeight - this. r e f s . t a b l e . g e t B o u n d i n g C l i e n t R e c t ( ) . t o p − 200 ; ∗ ∗ / / 自 己 写 的 d o m 标 签 如 d i v 布 局 则 不 能 再 用 上 面 的 refs.table.getBoundingClientRect().top - 200; **// 自己写的dom 标签 如div布局则不能再用上面的 refs.table.getBoundingClientRect().top200;//domdivel**
}

.draft-view {
background: #f3f3f3;
padding: 10px;
margin: 0;
min-height: calc(100vh - 30px);
.main-panel {
height: calc(100vh - 160px);
/deep/ .el-scrollbar {
height: calc(100vh - 240px);
.el-scrollbar__wrap {
overflow-x: hidden;
}
}
}
}在这里插入图片描述

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值