1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > vue 监听滚动条 到底事件

vue 监听滚动条 到底事件

时间:2022-04-28 17:11:20

相关推荐

vue 监听滚动条 到底事件

滚动条到底之后 去执行点啥

mounted() {let that = this;this.$nextTick(() => {// this.initScroll()window.onscroll = function () {//变量scrollTop是滚动条滚动时,距离顶部的距离var scrollTop =document.documentElement.scrollTop || document.body.scrollTop;//变量windowHeight是可视区的高度var windowHeight =document.documentElement.clientHeight || document.body.clientHeight;//变量scrollHeight是滚动条的总高度var scrollHeight =document.documentElement.scrollHeight || document.body.scrollHeight;//滚动条到底部的条件if (scrollTop + windowHeight == scrollHeight) {//写后台加载数据的函数 一定要用thatthat.getList();}};});},

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。