🐛 修复UID切换数据未刷新

This commit is contained in:
目棃
2024-09-20 17:27:21 +08:00
parent 4e3ad5816f
commit c452be8cbb
2 changed files with 7 additions and 2 deletions

View File

@@ -41,7 +41,7 @@ onMounted(async () => {
}); });
watch( watch(
() => props.cur, () => props.uid,
async () => await refreshOverview(), async () => await refreshOverview(),
); );

View File

@@ -57,7 +57,7 @@ import { path } from "@tauri-apps/api";
import { UnlistenFn, listen } from "@tauri-apps/api/event"; import { UnlistenFn, listen } from "@tauri-apps/api/event";
import { open, save } from "@tauri-apps/plugin-dialog"; import { open, save } from "@tauri-apps/plugin-dialog";
import { writeTextFile } from "@tauri-apps/plugin-fs"; import { writeTextFile } from "@tauri-apps/plugin-fs";
import { onMounted, ref, computed, onUnmounted } from "vue"; import { onMounted, ref, watch, computed, onUnmounted } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import showConfirm from "../../components/func/confirm.js"; import showConfirm from "../../components/func/confirm.js";
@@ -116,6 +116,11 @@ onMounted(async () => {
achiListener = await listen<number>("updateAchi", async () => await refreshOverview()); achiListener = await listen<number>("updateAchi", async () => await refreshOverview());
}); });
watch(
() => uidCur,
async () => await refreshOverview(),
);
onUnmounted(async () => { onUnmounted(async () => {
if (achiListener !== null) { if (achiListener !== null) {
achiListener(); achiListener();