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]); }); };