-
首先利用ElementUI中的
el-scrollbar
增加滚动条, 并将生效高度绑定数据<el-scrollbar :height="scrollbarHeight"> <div class="classShowInfoMainOfVulnerability" v-for="(item,index) in infoList" :key="index" @click="toVulnerabilityDetail" > ······ </div> </el-scrollbar>
-
界面加载完成后, 设置生效高度为浏览器高度的70%, 并监听浏览器变化事件, 实时更新高度
mounted() { this.scrollbarHeight = document.documentElement.clientHeight * 0.7 + "px" window.onresize = () => { if (this.scrollbarHeight) this.scrollbarHeight = document.documentElement.clientHeight * 0.7 + "px" }; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。