Forráskód Böngészése

[0806] 修复:切换当前页签时,其位置会错乱

taosj 1 hónapja
szülő
commit
012c0fe267

+ 4 - 4
forecast-backend-vue/src/components/layout/HistoryNav.vue

@@ -193,12 +193,12 @@ const addHistory = async (item) => {
   try {
     // 检查是否已存在相同路径
     const index = historyList.value.findIndex(h => h.path === item.path);
-    
-    // 如果存在,先删除旧的
+
+    // 如果已存在,保持原有顺序,不做调整
     if (index > -1) {
-      historyList.value.splice(index, 1);
+      return;
     }
-    
+
     // 如果是工作台,确保它始终在第一位
     if (item.path === '/ufo/home/workbench') {
       historyList.value.unshift(item);