components.ts 528 B

1234567891011121314151617
  1. import Components from 'unplugin-vue-components/vite';
  2. import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
  3. import IconsResolver from 'unplugin-icons/resolver';
  4. export default (path: any) => {
  5. return Components({
  6. resolvers: [
  7. // 自动导入 Element Plus 组件
  8. ElementPlusResolver(),
  9. // 自动注册图标组件
  10. IconsResolver({
  11. enabledCollections: ['ep']
  12. })
  13. ],
  14. dts: path.resolve(path.resolve(__dirname, '../../src'), 'types', 'components.d.ts')
  15. });
  16. };