mirror of
https://github.com/chansee97/nova-admin.git
synced 2025-04-05 19:41:59 +08:00
fix(header): 修复面包屑类型错误
This commit is contained in:
parent
75cb85bc8b
commit
c7249558a6
@ -17,10 +17,7 @@ const router = useRouter();
|
||||
const routeStore = useRouteStore();
|
||||
const { routerPush } = useAppRouter();
|
||||
const routes = computed(() => {
|
||||
return routeStore.createBreadcrumbFromRoutes(
|
||||
(router.currentRoute.value.name as string) || '/',
|
||||
routeStore.userRoutes,
|
||||
);
|
||||
return routeStore.createBreadcrumbFromRoutes(router.currentRoute.value.name as string!, routeStore.userRoutes);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -33,7 +33,7 @@ export const useRouteStore = defineStore('route-store', {
|
||||
router.removeRoute('appRoot');
|
||||
},
|
||||
/* 根据当前路由的name生成面包屑数据 */
|
||||
createBreadcrumbFromRoutes(routeName: string, userRoutes: AppRoute.Route[]) {
|
||||
createBreadcrumbFromRoutes(routeName = '/', userRoutes: AppRoute.Route[]) {
|
||||
const path: AppRoute.Route[] = [];
|
||||
// 筛选所有包含目标的各级路由组合成一维数组
|
||||
const getPathfromRoutes = (routeName: string, userRoutes: AppRoute.Route[]) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user