feat: 代码保持一致

This commit is contained in:
xingyu4j
2025-10-14 10:21:57 +08:00
parent c19097ec0c
commit 0a09970efb
6 changed files with 28 additions and 49 deletions

View File

@@ -6,11 +6,11 @@ const modules = import.meta.glob('../views/**/*.{vue,tsx}');
* 注册一个异步组件
* @param componentPath 例:/bpm/oa/leave/detail
*/
export const registerComponent = (componentPath: string) => {
export function registerComponent(componentPath: string) {
for (const item in modules) {
if (item.includes(componentPath)) {
// 使用异步组件的方式来动态加载组件
return defineAsyncComponent(modules[item] as any);
}
}
};
}