WebApp【公共组件库】@前端(For Git Submodule)
Tevin
2020-12-21 bde60a4ab1c176bef2f15a36b5e355708a4a1939
plugins/infiniteScroll/CInfiniteScroll.vue
@@ -10,10 +10,16 @@
        @scroll="evt=>onScroll(evt)"
    >
        <slot />
        <view class="bottom">
            <view v-if="loading">加载中,请稍后...</view>
        <view class="c-infinite-bottom">
            <view
                class="loading"
                v-if="loading"
            >加载中,请稍后...</view>
            <view v-if="ending">
                <text v-if="pageTatal > 0">-- 没有更多了 --</text>
                <text
                    class="ended"
                    v-if="pageTotal > 0"
                >-- 没有更多了 --</text>
                <text
                    class="empty"
                    v-else
@@ -68,6 +74,8 @@
                next: this.current + 1,
                // 加载成功
                success: (options) => {
                    setTimeout(() => {
                        this.loading = false;
                    // 没有数据
                    if (!options.pageTotal || options.pageTotal <= 0) {
                        this.ending = true;
@@ -81,8 +89,6 @@
                            this.ending = true;
                        }
                    }
                    setTimeout(() => {
                        this.loading = false;
                    }, 100);
                },
                // 加载失败