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