From fa721f18a4f5e1ae6e3315739cee1582904e3554 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期六, 19 十月 2024 16:01:59 +0800
Subject: [PATCH] 模板修改

---
 src/App.vue |   33 +++++++++++++++++++++++++++++----
 1 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/src/App.vue b/src/App.vue
index ec9032c..eebe177 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,11 +1,36 @@
 <template>
-  <div id="app">
-    <router-view />
-  </div>
+    <div id="app">
+        <router-view v-if="isRouterAlive" />
+    </div>
 </template>
 
 <script>
 export default {
-  name: 'App'
+    name: 'App',
+    provide() {
+        return {
+            reload: this.reload
+        }
+    },
+    data() {
+        return {
+            isRouterAlive: true
+        }
+    },
+    mounted() {
+        // 鍏抽棴娴忚鍣ㄧ獥鍙g殑鏃跺�欐竻绌烘祻瑙堝櫒缂撳瓨鍦╨ocalStorage鐨勬暟鎹�
+        window.onbeforeunload = function (e) {
+            // var storage = window.localStorage;
+            // storage.clear()
+        }
+    },
+    methods: {
+        reload() {
+            this.isRouterAlive = false
+            this.$nextTick(function () {
+                this.isRouterAlive = true
+            })
+        }
+    }
 }
 </script>

--
Gitblit v1.8.0