mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-27 11:51:45 +08:00
refactor: migrate demo applications to playground (#4116)
* chore: detail adjustment * refactor: Migrate demo applications to playground * perf: logic optimization * chore: update docs * chore: update docs
This commit is contained in:
@@ -100,15 +100,11 @@ export function useTabbar() {
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
// 这里不能用route,用route时,vue-router会自动将父级meta进行合并
|
||||
const routes = router.getRoutes();
|
||||
const currentRoute = routes.find((item) => item.path === route.path);
|
||||
if (currentRoute) {
|
||||
tabbarStore.addTab({
|
||||
...route,
|
||||
meta: currentRoute.meta,
|
||||
} as unknown as RouteLocationNormalizedGeneric);
|
||||
}
|
||||
const meta = route.matched?.[route.matched.length - 1]?.meta;
|
||||
tabbarStore.addTab({
|
||||
...route,
|
||||
meta: meta || route.meta,
|
||||
});
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
Reference in New Issue
Block a user