问题描述:
在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,
- components conflicts naming other withcomponents conflicts naming other component_name ess-shardings-with-names multi-word-component-names multi-word-component-names multi quot word setup component_name defineoptions component dispatcherservlet 39 name with namedsharding-gives-a-way-to-expr ess-shardings-with-names 中报multi-word-component-names multi quot other