Files
iot-device-management-frontend/apps/web-antd/src/utils/routerHelper.ts

17 lines
450 B
TypeScript
Raw Normal View History

import { defineAsyncComponent } from 'vue';
const modules = import.meta.glob('../views/**/*.{vue,tsx}');
2025-06-15 16:54:18 +08:00
/**
*
* @param componentPath :/bpm/oa/leave/detail
*/
2025-10-14 10:21:57 +08:00
export function registerComponent(componentPath: string) {
for (const item in modules) {
if (item.includes(componentPath)) {
// 使用异步组件的方式来动态加载组件
return defineAsyncComponent(modules[item] as any);
}
}
2025-10-14 10:21:57 +08:00
}