naming conflicts with other components【vue3】
问题描述:
在vue3中有相同名称的文件时,会报错
[unplugin-vue-components] component "Xxx"(D:/a/b/xxx.vue) has naming conflicts with other components, ignored.
解决方案:
修改vite.config.ts
加上 directoryAsNamespace: true
export default defineConfig(({ command }) => {
return {
plugins: [
vue(),
// 组件按需引入
ViteComponents({
directoryAsNamespace: true,
posted on 2024-01-09 19:47 zyp_java_net 阅读(220) 评论(0) 编辑 收藏 举报