methods: {
   scrollBottom() {
       let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
       let clientHeight = document.documentElement.clientHeight;
       let scrollHeight = document.documentElement.scrollHeight;
       if (scrollTop + clientHeight >= scrollHeight) {
          console.log('到底啦')
       }
   },
},
created() {
   window.addEventListener('scroll', this.scrollBottom); 
},
destroyed() {
   window.removeEventListener('scroll', this.scrollBottom) //页面离开后销毁监听事件
},

Logo

前往低代码交流专区

更多推荐