1.html代码
<div class="container">
<el-scrollbar class="dashboard-container"> </el-scrollbar>
</div>
2.css样式
//这里记得加scoped
<style scoped>
//用来隐藏横向滚动条
::v-deep .el-scrollbar__wrap {
overflow-x: hidden;
}
.container {
background-color: #eeeeee;
padding: 16px;
box-sizing: border-box;
width: 100%;
height: 100vh;
}
.dashboard-container {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
border-radius: 12px;
background-color: #fff;
}
</style>
3.效果图