fix: 优化页面标签组件与相关路由配置

This commit is contained in:
ZhuRui
2026-07-27 16:30:12 +08:00
parent 9b8d71a269
commit fc621118e2
4 changed files with 26 additions and 2 deletions
+5 -2
View File
@@ -63,12 +63,15 @@ router.afterEach((to) => {
// 隐藏的路由(如详情页、编辑页)不进 tab,避免标签栏被噪声污染
// /login 也不进 tab
if (to.meta?.hideInMenu || to.path === '/login') return;
if (typeof to.name !== 'string' || typeof to.meta?.title !== 'string') return;
if (typeof to.meta?.title !== 'string') return;
const componentName = (to.meta.componentName as string) || (to.name as string);
if (!componentName) return;
const { addTab } = useTabsStore();
addTab({
path: to.path,
name: to.name,
name: componentName,
title: to.meta.title,
});
});