From 8eff378710b7074fe7241c73f3975345ffe8959b Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期四, 19 九月 2024 12:56:58 +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..6bb22ac 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