新项目使用到页面滚动,同事引入了element-ui中的滚动条,特此记录下
情况一:
则直接在c页面最外层添加代码:
<template>
<el-scrollbar ref="scrollCon" class="no-scroll-x flex-full overflow-hidden">
......
</el-scrollbar>
</template>
情况二:
这种情况需要给最外层盒子设置display:flex;flex-direction: column;则滚动页面才能自适应
<template>
<div class="BillBrowsPage He-scrollcss">
<div class="title_temp">
<h2>
话单统计
</h2>
</div>
<el-scrollbar ref="scrollCon" class="no-scroll-x flex-full overflow-hidden">
<div class="search_condition">
.....
</div>
<!-- 表格内容 -->
<div class="table_box">
......
</div>
</el-scrollbar>
</div>
</template>
<style scoped >
.He-scrollcss{
width: 100%;
padding: 15px;
height: 100%;
display: flex;
flex-direction: column;
}
.overflow-hidden {
overflow: hidden;
}
.flex-full{
flex:1;
}
</style>