Skip to content

Commit

Permalink
fix: refresh Pagination when the select type changed (#17)
Browse files Browse the repository at this point in the history
当修改类型时,分页组件进行刷新

fixes #16

```release-note
None
```
  • Loading branch information
GodlessLiu authored Sep 12, 2023
1 parent 11de882 commit 5a37006
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion console/src/components/AppStoreTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VPagination,
VSpace,
} from "@halo-dev/components";
import { ref } from "vue";
import { ref, watch } from "vue";
import AppCard from "./AppCard.vue";
import { useLocalStorage } from "@vueuse/core";
import AppDetailModal from "./AppDetailModal.vue";
Expand Down Expand Up @@ -121,6 +121,11 @@ const handleSelectNext = async () => {
selectedApp.value = items[0];
}
};
// page refresh
watch([selectedPriceMode, selectedSort, keyword], () => {
page.value = 1;
});
</script>

<template>
Expand Down
6 changes: 5 additions & 1 deletion console/src/views/AppStore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "@halo-dev/components";
import { useQuery } from "@tanstack/vue-query";
import { useLocalStorage } from "@vueuse/core";
import { computed, nextTick } from "vue";
import { computed, nextTick, watch } from "vue";
import { ref } from "vue";
import RiApps2Line from "~icons/ri/apps-2-line";
Expand Down Expand Up @@ -172,6 +172,10 @@ const handleSelectNext = async () => {
selectedApp.value = items[0];
}
};
// page refresh
watch([selectedPriceMode, selectedType, selectedSort, onlyQueryInstalled, keyword], () => {
page.value = 1;
});
</script>

<template>
Expand Down

0 comments on commit 5a37006

Please sign in to comment.