webloong
webloong
  • 发布:2023-08-08 10:01
  • 更新:2023-11-23 11:20
  • 阅读:216

list组件loading事件只触发一次!!!!

分类:uni-app

list组件loading事件为什么只触发了一次?!

<template>  
    <view class="index">  

        <list class="index-box" ref='list' loadmoreoffset="30">  

            <cell>  

                <view class="num-item" v-for="num in len">  

                    <text>{{num}}</text>  

                </view>  

            </cell>  
            <loading @loading="onScroll"  height="20"></loading>  
        </list>  

    </view>   

</template>  

<script>  
    const app = getApp().globalData;  

    export default {  

        data() {  

            return {  
                len: 10,  
                lists: []  

            }  

        },  

        methods: {  

            onScroll() {  
                this.len += 10  
                console.log('触发@loadmore')  

                setTimeout(() => {  
                    console.log(11111111111)  
                    this.$refs["list"].resetLoadmore();  

                }, 1000)  

            }  

        }  

    }  
</script>  

<style scoped lang="scss">  
    .num-item {  

        width: 750rpx;  

        height: 300rpx;  

        background-color: pink;  

        margin-top: 10rpx;  

        display: flex;  

        align-items: center;  

        justify-content: center;  

    }  

    .index-box {  

        width: 750rpx;  

        height: 1200rpx;  

        // flex: 1;  

    }  
</style>
2023-08-08 10:01 负责人:无 分享
已邀请:
MoreBetter

MoreBetter

官方有回答吗?

要回复问题请先登录注册