| 123456789101112131415161718192021 |
- import type { App } from 'vue';
- import { components } from './components';
- export * from './components';
- export type ComponentType = keyof typeof components;
- export const install = function (app: App) {
- Object.keys(components).forEach(key => {
- const component = components[key as keyof typeof components] as { install?: (app: App<any>) => any };
- if (component?.install) {
- console.log('注册组件:', key);
- app.use(component as any);
- }
- });
-
- return app;
- };
- export default {
- version: '1.0.0',
- install,
- };
|