Vue3.x属性继承报错解决

编写vue组件的时候莫名报了下面的警告:

[Vue warn]: Extraneous non-props attributes (border, style) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.
at xxxx(发生问题的组件位置)
at ...

解决:

在自定义组件上添加了border、style属性,而自定义组件内部又未去接收,因此警告了。
所以,要么在组件内部加上属性接收。如果是在第三方库UI库的话,建议直接去掉这些属性。


版权声明:本文为qq_38888512原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。