SmileZXLee / uni-z-paging

【uni-app下拉刷新、上拉加载】高性能,全平台兼容。支持vue、nvue、vue2、vue3,使用wxs+renderjs实现。支持虚拟列表,支持自定义下拉刷新、上拉加载更多,支持自动管理空数据图、点击返回顶部,支持聊天分页、本地分页,支持国际化等100+项配置
https://z-paging.zxlee.cn
MIT License
871 stars 69 forks source link

this.$refs.paging.complete is not a function #119

Closed copyorpaste closed 5 months ago

copyorpaste commented 5 months ago

编译平台 使用HbuilderX还是npm方式编译出现的问题? HbuilderX VUE版本 在vue2还是vue3中出现的问题,是nvue还是vue?(如:vue2+nvue) Vue3 运行平台 在运行到哪个平台中出现的问题?(如:App、微信小程序、h5) 微信小程序 z-paging版本 在哪个版本的z-paging中出现的问题? 2.7.6 问题描述 请详细描述问题,最好说明复现步骤,尽可能附上代码或截图 无法使用z-paging, 微信小程序报错

image

打印的this.refs.paging为

image

所有的方法都是这个报错 代码:

<template>
    <view>
        <z-paging ref="paging" :fixed="true" v-model="userList" @query="queryList" v-for="item in 10">
            <template #top>
                aaa
            </template>
            <UserCard v-for="(item,index) in userList" :user="item">
                <view class="line-option_option_btn" @click="edit(item.id)">编辑</view>
                <view class="line-option_option_more">
                    <view class="">更多</view>
                    <uni-icons type="down" color="#2D71FF" size="24rpx"></uni-icons>
                </view>
            </UserCard>
            <template #buttom>
                <uv-safe-bottom></uv-safe-bottom>
            </template>
        </z-paging>

    </view>

</template>

<script>
    import {
        listUserPage
    } from '../../../../api/user/user';
    export default {
        data() {
            return {
                userList: [],
                pageNo: 1,
                pageSize: 10
            };
        },
        methods: {
            edit(id) {
                uni.navigateTo({
                    url: "/pages/operation/user/edit/edit?id=" + id,
                })
            },
             queryList:async function(pageNo, pageSize) {
                let query = {
                    pageNo: pageNo,
                    pageSize: pageSize
                }
                let res = await  listUserPage(query)
                console.log(res.list,this.$refs.paging);
                this.$refs.paging.complete(res.list);
            }
        },
        onLoad: async function() {
            // await this.listUsers()

        },
        onReady() {

        },
        onShow() {

        }
    }
</script>
copyorpaste commented 5 months ago

v-for="item in 10" 去掉就么问题了。不小心加的额。