From 74a7a2bbef241a023110ff24c8e7c84025e267f5 Mon Sep 17 00:00:00 2001 From: qinxianzhangyao <11053546+qinxianzhangyao@user.noreply.gitee.com> Date: 星期四, 25 四月 2024 10:09:38 +0800 Subject: [PATCH] qxtj --- src/App.vue | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/src/App.vue b/src/App.vue index f37c0d8..138b2fa 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ <template> <div id="app"> - <router-view /> + <router-view v-if="isRouterAlive"/> <theme-picker /> </div> </template> @@ -10,6 +10,16 @@ export default { name: "App", + provide() { + return { + reload: this.reload, + }; + }, + data() { + return { + isRouterAlive: true, + }; + }, components: { ThemePicker }, metaInfo() { return { @@ -21,6 +31,14 @@ }, created() { }, + methods: { + reload() { + this.isRouterAlive = false; + this.$nextTick(function () { + this.isRouterAlive = true; + }); + }, + }, }; </script> <style scoped> -- Gitblit v1.8.0