From d83c862df0101148f0f300f5db252b78b552f78f Mon Sep 17 00:00:00 2001
From: wujingjing <gersonwu@qq.com>
Date: 星期四, 16 一月 2025 10:43:18 +0800
Subject: [PATCH] BasicMap

---
 src/utils/route.ts |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/src/utils/route.ts b/src/utils/route.ts
index dec9169..baf54ff 100644
--- a/src/utils/route.ts
+++ b/src/utils/route.ts
@@ -9,25 +9,16 @@
 
 /**
  * 鎸夎矾鐢卞悕绉拌烦杞嚦鎸囧畾璺敱
- * 璺敱宸茬紦瀛樻椂锛屼細娓呴櫎缂撳瓨
+ * 鐪� meta 璁剧疆鐨勫弬鏁帮紝鍒ゆ柇鏄惁闇�瑕佽缃矾鐢辩紦瀛�
  * @param routeLocation 璺敱浣嶇疆锛屼笌 router.push 鍙傛暟涓�鑷�
  */
 export const gotoRoute = (routeLocation: RouteLocationName) => {
-	const storesKeepAliveNames = useKeepALiveNames();
 	const routeName = routeLocation.name;
-	const { cachedViews } = storeToRefs(storesKeepAliveNames);
-	const isInclude = cachedViews.value.includes(routeName);
-
-	if (isInclude) {
-		storesKeepAliveNames.delCachedView({
-			name: routeName,
-		});
-	}
-	router.push(routeLocation).then(() => {
-		if (isInclude) {
-			cachedViews.value.push(routeName);
-		}
-	});
+	
+	const storesKeepAliveNames = useKeepALiveNames();
+	const gotoRoute = router.getRoutes().find((item) => item.name === routeName);
+	storesKeepAliveNames.addCachedView(gotoRoute)
+	router.push(routeLocation);
 };
 
 /**

--
Gitblit v1.9.3