index.ts 422 B

1234567891011121314151617181920
  1. import type { App } from 'vue';
  2. import { components } from './components';
  3. export * from './components';
  4. export const install = function (app: App) {
  5. Object.keys(components).forEach(key => {
  6. const component = components[key];
  7. if (component?.install) {
  8. console.log('注册组件:', key);
  9. app.use(component as any);
  10. }
  11. });
  12. return app;
  13. };
  14. export default {
  15. version: '1.0.0',
  16. install,
  17. };