handleScroll(e) { const scrollTop = e.target.scrollTop const windowHeight = e.target.clientHeight const scrollHeight = e.target.scrollHeight if (scrollTop + windowHeight >= scrollHeight) { console.log('到达底部了') } if (scrollTop === 0 && this.oldv !== 0) { console.log('到达头部了') } },
标签:vue,const,target,console,事件,scrollTop,scroll,scrollHeight From: https://www.cnblogs.com/zylzh/p/16975299.html