This commit is contained in:
hezhidong
2025-05-16 08:55:13 +08:00
parent e62c3fce70
commit 839703dc1a
66 changed files with 5029 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<template>
<router-view v-if="isRouterAlive"></router-view>
</template>
<script setup>
import { onMounted, ref, nextTick, provide } from "vue";
import { useStore } from "vuex";
// 局部组件刷新
const isRouterAlive = ref(true);
const globalStore = useStore();
const reload = () => {
isRouterAlive.value = false;
nextTick(() => {
isRouterAlive.value = true;
console.log("数据刷新成功");
});
};
provide("reload", reload);
onMounted(() => {
globalStore.dispatch("user/changeThem", "#4060c7");
});
</script>
<style scoped lang="scss"></style>