From 85a0977a3a11e49a5d2defc214447578f6cb0ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E9=A3=8E?= <18012261618@126.com> Date: Wed, 3 Apr 2024 15:25:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dreload=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E6=9C=AA=E4=BF=AE=E6=94=B9loading=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-vusion/components/list-view/index.vue | 7 ++++++- src/utils/DataSource/index.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src-vusion/components/list-view/index.vue b/src-vusion/components/list-view/index.vue index 3ba55aa43..989c03fc5 100644 --- a/src-vusion/components/list-view/index.vue +++ b/src-vusion/components/list-view/index.vue @@ -201,8 +201,13 @@ export default { async reload() { // readme: 目前使用场景中存在着用户通过props间接改变组件内部状态后同步调用reload的情况,在这里等待组件内部状态更新完成。 await new Promise((res) => { this.$nextTick(() => res()); }); - this.currentDataSource.reload(); + this.currentLoading = true; + + await this.currentDataSource.reload(); + + this.currentLoading = false; + const { paging: oldPaging, } = this.currentDataSource; diff --git a/src/utils/DataSource/index.js b/src/utils/DataSource/index.js index 1e1fb24f9..2d580ff7c 100644 --- a/src/utils/DataSource/index.js +++ b/src/utils/DataSource/index.js @@ -447,7 +447,7 @@ const VueDataSource = Vue.extend({ number: 1, }); - this.load(); + return this.load(); }, page(paging) { this.paging = paging;