mirror of
https://github.com/xxxsf/vue3-h5-template.git
synced 2025-04-05 04:12:45 +08:00
21 lines
669 B
TypeScript
21 lines
669 B
TypeScript
/**
|
|
* @name AutoRegistryComponents
|
|
* @description 按需加载,自动引入组件
|
|
*/
|
|
import Components from 'unplugin-vue-components/vite';
|
|
import { VueUseComponentsResolver } from 'unplugin-vue-components/resolvers';
|
|
export const AutoRegistryComponents = () => {
|
|
return Components({
|
|
// dirs: ['src/components'],
|
|
extensions: ['vue', 'md'],
|
|
deep: true,
|
|
dts: 'types/components.d.ts',
|
|
directoryAsNamespace: false,
|
|
globalNamespaces: [],
|
|
directives: true,
|
|
include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
|
|
exclude: [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/, /[\\/]\.nuxt[\\/]/],
|
|
resolvers: [VueUseComponentsResolver()],
|
|
});
|
|
};
|