横向滚动
- 隐藏横向滚动条
.el-scrollbar__wrap {
overflow-x: hidden;
}
- 显示横向滚动条
.el-scrollbar__wrap {
overflow-x: auto;
}
.el-scrollbar__view {
display: inline-block;
}
监听滚动事件
<el-scrollbar ref="scrollbar">
...
</el-scrollbar>
<script>
...
mounted() {
this.handleScroll()
},
methods: {
handleScroll() {
let scrollbarEl = this.$refs.scrollbar.wrap
scrollbarEl.onscroll = () => {
const scrollTop = scrollbarEl.scrollTop
}
}
}
</script>
标签:__,el,滚动,横向,scrollbar,wrap
From: https://www.cnblogs.com/gongxiansheng/p/16710541.html