Browse Source

fixup! fix: 修复前端Tag刷新无效的BUG

喵你个旺呀 1 year ago
parent
commit
be88c77296
1 changed files with 3 additions and 1 deletions
  1. 3 1
      Web/src/layout/routerView/parent.vue

+ 3 - 1
Web/src/layout/routerView/parent.vue

@@ -67,10 +67,12 @@ onBeforeMount(() => {
 	state.keepAliveNameList = keepAliveNames.value;
 	mittBus.on('onTagsViewRefreshRouterView', (fullPath: string) => {
 		state.keepAliveNameList = keepAliveNames.value.filter((name: string) => route.name !== name);
+    const cachedViewsTemp = cachedViews.value;
+    cachedViews.value = [];
 		state.refreshRouterViewKey = '';
 		state.iframeRefreshKey = '';
 		nextTick(() => {
-      fullPath = (fullPath.indexOf('?') > 0 ? '&' : '?') + '_$t=' + Math.random();
+      cachedViews.value = cachedViewsTemp;
       state.refreshRouterViewKey = fullPath;
       state.iframeRefreshKey = fullPath;
       state.keepAliveNameList = keepAliveNames.value;