Skip to content

Commit

Permalink
perf: loading
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Feb 26, 2024
1 parent 5c8ae7a commit d418b3e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
import type { SortState } from 'naive-ui/es/data-table/src/interface';
import {
computed,
onMounted,
reactive,
shallowReactive,
shallowRef,
Expand All @@ -42,11 +43,14 @@ import { RouterLink, useRouter } from 'vue-router';
const router = useRouter();
const snapshots = shallowRef<Snapshot[]>([]);
const loading = shallowRef(true);
const updateSnapshots = async () => {
loading.value = true;
snapshots.value = (await shallowSnapshotStorage.getAllItems()).reverse();
checkedRowKeys.value = [];
loading.value = false;
};
updateSnapshots();
onMounted(updateSnapshots);
const filterOption = shallowReactive({
query: ``,
actualQuery: ``,
Expand Down Expand Up @@ -428,6 +432,7 @@ const shareDlgShow = shallowRef(false);
size="small"
class="flex-1"
flexHeight
:loading="loading"
/>
</div>
<NModal
Expand Down

0 comments on commit d418b3e

Please sign in to comment.