uniapp 子页面 滚动监听 是否到底

主要属性:  handleScrollToLower

复制代码
<template>
    <view class="menu">
        <scroll-view 
            id="scrollContainer" 
            class="scroll" 
            scroll-y 
            @scrolltolower="handleScrollToLower"
            >
            <view class="item">1</view>
            <view class="item">2</view>
            <view class="item">3</view>
            <view class="item">4</view>
            <view class="item">5</view>
        </scroll-view>
    </view>
</template>

<script>
    export default {
        data() {
            return {

            }
        },
        methods: {
            handleScrollToLower(){
                console.log('已经滚动到底部了');
            }
        }
    }
</script>

<style scoped>
.item {
    height: 300rpx;
    width: 100%;
    background-color: beige;
    border-bottom: 5rpx solid orange;
}

.scroll{
    height: 770rpx;
}
</style>
复制代码

 

posted @   武卡卡  阅读(516)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架

喜欢请打赏

扫描二维码打赏

支付宝打赏

点击右上角即可分享
微信分享提示