fix: eslint errors

This commit is contained in:
hw
2025-10-30 16:33:33 +08:00
parent 8e174a8308
commit 20f838adde
51 changed files with 4433 additions and 21 deletions

View File

@@ -1,3 +1,8 @@
import type {
RouteLocationNormalized,
RouteRecordNormalized,
} from 'vue-router';
import { defineAsyncComponent } from 'vue';
const modules = import.meta.glob('../views/**/*.{vue,tsx}');
@@ -13,3 +18,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[],
};
};