1234567891011121314const handleScroll = () => { let scrollTop = document.documentElement.scrollTop || document.body.scrollTop; let clientHeight = document.documentElement.clientHeight; let scrollHeight = document.documentElement.scrollHeight; if (scrollTop + clientHeight >= scrollHeight) { console.log("滚动到底部了") }}onMounted(() => { window.addEventListener('scroll', handleScroll)})onUnmounted(() => { window.removeEventListener('scroll', handleScroll)})