We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
文件结构
├── src/ │ ├── components/ │ │ └── src/ │ │ │ └── col.vue │ └── index.ts
index.ts
import Col from './src/col.vue' import Col2 from './src/col2.vue' export { Col ,Col2 }
Components({ resolvers: [ ElementPlusResolver(), ], dts: resolve('src/components.d.ts'), globs: ['src/components/**/index.ts'] }),
这样配置得到的是
col: typeof import('./components/col/index.ts')['default']
我改如何viteconfig中配置了,才能准确的导入了?
The text was updated successfully, but these errors were encountered:
你可以修改你的目录结构
├── src/ │ ├── components/ │ │ └── col.vue
不需要src/components/index.ts这个文件
因为最新版unplugin-vue-components默认支持src/components目录下的组件自动导入,不需要做额外配置 vite config移除globs: ['src/components/**/index.ts'],如下
unplugin-vue-components
src/components
globs: ['src/components/**/index.ts']
Components({ resolvers: [ ElementPlusResolver(), ], dts: ‘components.d.ts’, }),
如果你是第三方组件库作者,可以参考这篇文章workspace-autoimport
Sorry, something went wrong.
No branches or pull requests
文件结构
index.ts
这样配置得到的是
我改如何viteconfig中配置了,才能准确的导入了?
The text was updated successfully, but these errors were encountered: