<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