fix: 修复代码生成异常提示

This commit is contained in:
xlsea
2024-11-04 11:16:53 +08:00
parent d5479c2f68
commit df5dd24c29
10 changed files with 83 additions and 65 deletions

View File

@ -93,6 +93,9 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
function parseRouter(route: ElegantConstRoute, parent?: ElegantConstRoute) {
if (authRouteMode.value === 'dynamic') {
if (route.component === 'Layout' && route.path === '/' && route.children?.length) {
Object.assign(route, route.children[0]);
}
// @ts-expect-error no query field
const query = route.query ? String(route.query) : undefined;
route.path = route.path.startsWith('//') ? route.path.substring(1) : route.path;