Skip to content

Commit

Permalink
fix: 修复reload时的未修改loading问题
Browse files Browse the repository at this point in the history
  • Loading branch information
YufJi committed Apr 3, 2024
1 parent 7cdfab3 commit 85a0977
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src-vusion/components/list-view/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/DataSource/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ const VueDataSource = Vue.extend({
number: 1,
});

this.load();
return this.load();
},
page(paging) {
this.paging = paging;
Expand Down

0 comments on commit 85a0977

Please sign in to comment.