20 lines
600 B
JavaScript
Raw Normal View History

2025-01-25 02:48:00 +00:00
import * as components from '../../../main/src/components';
// const modules = import.meta.glob('../../../main/src/components/**/**.vue');
// const components = Object.keys(modules).reduce((acc, path) => {
// const component = modules[path].default || modules[path];
// const componentName = path
// .split('/')
// .pop()
// .replace(/\.\w+$/, '');
// acc[componentName] = component;
// return acc;
// }, {});
// 全局注册组件
export const registerGlobalComponents = (app) => {
Object.keys(components).forEach((key) => {
app.component(key, components[key]);
});
};