美文网首页
[unplugin-vue-components] compon

[unplugin-vue-components] compon

作者: AR7_ | 来源:发表于2022-09-13 16:38 被阅读0次

在修改组件库的时候,出现一个问题,一直显示Example2组件报错,把它注释掉了,其他组件也会报错,所以基本可以断点,这个是共性问题,不是单个页面的问题,报错信息如下所示:

[unplugin-vue-components] component "Example2"... has naming conflicts with other components, ignored.

意思是说,命名重复了,之前一直没有这个问题的,只是因为引用了unplugin-vue-components导致的,所以很大概率是这个插件的问题,那就网上查了一下,发现别人也是碰到这个问题的,解决方式就是,需要在vite.config.ts中进行设置,如下所示:

    Components({
      resolvers: [ElementPlusResolver()],
      // 设置为true即可。
      directoryAsNamespace: true
    }),

相关文章

网友评论

      本文标题:[unplugin-vue-components] compon

      本文链接:https://www.haomeiwen.com/subject/jyjhortx.html