From 308c34038375c64f94c07a92736cb167568359e6 Mon Sep 17 00:00:00 2001
From: children117cl <278950112@qq.com>
Date: 星期一, 31 五月 2021 17:20:44 +0800
Subject: [PATCH] 调整bannerOpts.js代码排班

---
 src/router/index.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/router/index.js b/src/router/index.js
index ebfad34..378e515 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -101,6 +101,17 @@
 
 const router = createRouter()
 
+// 瀹堝崼锛屽鐞唊eepAlive鍛ㄦ湡锛岀敤isBack鏍囪鏄惁灞炰簬浠庡睘椤甸潰鍚庨��
+router.beforeEach(function(to, from, next) {
+  // 鍒ゆ柇鏄惁浠庝粠灞為〉闈㈠悗閫�
+  if (to.meta.keepAlive && from.meta.activeMenu === to.path) {
+    to.meta.isBack = true
+  } else {
+    to.meta.isBack = false
+  }
+  next(true)
+})
+
 // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
 export function resetRouter() {
   const newRouter = createRouter()

--
Gitblit v1.8.0