diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index 6d5f425..aa6267b 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -185,7 +185,7 @@ function moveToCurrentTag() { if (tag.fullPath !== route.fullPath) { tagsViewStore.updateVisitedView({ name: route.name as string, - title: route.meta.title, + title: route.meta.title || "", path: route.path, fullPath: route.fullPath, affix: route.meta?.affix, diff --git a/types/router.d.ts b/types/router.d.ts index 0b6475b..99e187b 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -5,7 +5,7 @@ declare module "vue-router" { // 可以通过扩展 RouteMeta 接口来输入 meta 字段 interface RouteMeta { /** 菜单名称 */ - title: string; + title?: string; /** 菜单图标 */ icon?: string; /** 菜单是否隐藏 */