From 6bb8da1d317da366769d64120ee645c03f305023 Mon Sep 17 00:00:00 2001 From: Crunchy <3114200645@qq.com> Date: 星期四, 16 五月 2024 14:55:25 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/components/tool/scroll-paging.vue | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/tool/scroll-paging.vue b/src/components/tool/scroll-paging.vue index 41b2e10..367409d 100644 --- a/src/components/tool/scroll-paging.vue +++ b/src/components/tool/scroll-paging.vue @@ -2,14 +2,14 @@ <div class="scroll-pagination" ref="content" @scroll="onScroll"> <slot></slot> <el-button - v-if="isLoding" + v-show="isLoding" type="text" style="display: flex; margin: 0 auto; color: #909399" ><i class="el-icon-loading" style="font-size:20px"></i ></el-button> <el-button type="text" - v-if="finishLoding" + v-show="finishLoding" style="display: flex; margin: 0 auto; color: #909399" >宸茬粡娌℃湁鏇村鍟</el-button > @@ -23,6 +23,18 @@ finishLoding: { type:Boolean, default:false + }, + list:{ + type:Array, + default:()=>[] + } + }, + watch: { + list:{ + deep:true, + handler(){ + this.isLoding = false + } } }, data() { @@ -32,7 +44,7 @@ }, created(){ // 闃叉姈 - this.onScroll = this.debounce(this.scrollFn,2000); + this.onScroll = this.debounce(this.scrollFn,500); // 鑺傛祦 // this.onScroll = this.throttle(this.scrollFn,1000); }, @@ -55,8 +67,7 @@ this.isLoding = true setTimeout(() => { this.$emit('load') - this.isLoding = false - }, 1000) + }, 500) }, debounce(func, delay) { let timer = null; -- Gitblit v1.9.3