feat: 自动回复迁移
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import type {
|
||||
RouteLocationNormalized,
|
||||
RouteRecordNormalized,
|
||||
} from 'vue-router';
|
||||
|
||||
import { defineAsyncComponent } from 'vue';
|
||||
|
||||
const modules = import.meta.glob('../views/**/*.{vue,tsx}');
|
||||
@@ -14,3 +19,20 @@ export function registerComponent(componentPath: string) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const getRawRoute = (
|
||||
route: RouteLocationNormalized,
|
||||
): RouteLocationNormalized => {
|
||||
if (!route) return route;
|
||||
const { matched, ...opt } = route;
|
||||
return {
|
||||
...opt,
|
||||
matched: (matched
|
||||
? matched.map((item) => ({
|
||||
meta: item.meta,
|
||||
name: item.name,
|
||||
path: item.path,
|
||||
}))
|
||||
: undefined) as RouteRecordNormalized[],
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user