feat 优化标签

This commit is contained in:
Ironsp
2026-06-23 16:10:05 +08:00
parent 80a360fa0e
commit e4d014cf8c
2 changed files with 25 additions and 13 deletions

View File

@@ -37,7 +37,12 @@ export const useTagsViewStore = defineStore('tagsView', () => {
});
};
const addVisitedView = (view: RouteLocationNormalized): void => {
if (visitedViews.value.some((v: RouteLocationNormalized) => v.path === view.path)) return;
// 同时通过 path、fullPath、name 去重
if (visitedViews.value.some((v: RouteLocationNormalized) =>
v.path === view.path ||
v.fullPath === view.fullPath ||
(v.name && view.name && v.name === view.name)
)) return;
visitedViews.value.push(
Object.assign({}, view, {
title: view.meta?.title || 'no-name'