Extraneous non-props attributes (currNode) were passed to component but could not be automatically i
使用vue3开发过程中,碰到了这个问题:Extraneous non-props attributes (currNode) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.为什么呢?google上查找到的原
   ·  
 使用vue3开发过程中,碰到了这个问题:
Extraneous non-props attributes (currNode) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
为什么呢?
google上查找到的原因可能是你在组件模板中有多个根节点。参考Non-Prop Attributes | Vue.js。
  为了解决这个问题,我将所有元素都包含在一个容器元素中。禁用属性继承也可能有效,但我还没有尝试过。
最简单的解决方式就是屏蔽:
这个警告可以通过在export defaultdefineComponent({})中写“inheritAttrs: false”来解决
更多推荐
 
 



所有评论(0)