Fix watch warnings in Files.vue
This commit is contained in:
parent
86f696e87f
commit
a066ae6c39
@ -34,6 +34,7 @@ import {
|
|||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { files as api } from "@/api";
|
import { files as api } from "@/api";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
import { useFileStore } from "@/stores/file";
|
import { useFileStore } from "@/stores/file";
|
||||||
import { useLayoutStore } from "@/stores/layout";
|
import { useLayoutStore } from "@/stores/layout";
|
||||||
import { useUploadStore } from "@/stores/upload";
|
import { useUploadStore } from "@/stores/upload";
|
||||||
@ -51,6 +52,9 @@ const layoutStore = useLayoutStore();
|
|||||||
const fileStore = useFileStore();
|
const fileStore = useFileStore();
|
||||||
const uploadStore = useUploadStore();
|
const uploadStore = useUploadStore();
|
||||||
|
|
||||||
|
const { reload } = storeToRefs(fileStore);
|
||||||
|
const { error: uploadError } = storeToRefs(uploadStore);
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
const { t } = useI18n({});
|
const { t } = useI18n({});
|
||||||
@ -98,14 +102,11 @@ onUnmounted(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
watch(route, () => fetchData());
|
watch(route, () => fetchData());
|
||||||
// @ts-ignore
|
watch(reload, (newValue) => {
|
||||||
watch(fileStore.reload, (val) => {
|
newValue && fetchData();
|
||||||
if (val) {
|
|
||||||
fetchData();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
watch(uploadStore.error, (newValue, oldValue) => {
|
watch(uploadError, (newValue) => {
|
||||||
newValue && newValue !== oldValue && layoutStore.showError();
|
newValue && layoutStore.showError();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Define functions
|
// Define functions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user