VUE 中Element-ui 添加滚动条

时间:2021-05-19 10:22:32   收藏:0   阅读:110

<template>
<el-scrollbar
wrapClass="scrollbar-wrap"
:style="{height: scrollHeight}"
ref="scrollbarContainer">
<div>........</div>
</el-scrollbar>
</template>

<script>
data () {
return {
scrollHeight:‘0px‘
}
}
mounted(){
this.scrollHeight = window.innerHeight*0.7 + ‘px‘;
}

</script>

<style>

.el-scrollbar{
height: 90%;
.scrollbar-wrap{
overflow-x: hidden;
}
.el-scrollbar__bar{
}
}
</style>
 
如果没有不起效果,可以设置在app.vue中

 

原文:https://www.cnblogs.com/liang715200/p/14783359.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!