//获取节点
      const scrollDiv = this.$refs.mypklogList  //vue的写法 mypklogList是表现中 ref=“mypklogList”
      const scrollDiv=document.getElementById(‘id’) //js的写法 上面的和这个选择一个
      const offsetHeight = scrollDiv.offsetHeight;
      //绑定事件
      scrollDiv.addEventListener('scroll', function() {
        const scrollTop = scrollDiv.scrollTop;
        const scrollHeight = scrollDiv.scrollHeight;
        if (offsetHeight + scrollTop >= scrollHeight ) {
         	//触发事件
        }
      })```

Logo

前往低代码交流专区

更多推荐