Vue3 警告:[Vue warn]: Extraneous non-props attributes (tabindex, aria-describedby, class, style) we...

Vue 警告

[Vue warn]: Extraneous non-props attributes (tabindex, aria-describedby, class, style) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. 
  at <Index icon="language" tabindex="0" aria-describedby="el-popper-6649"  ... > 
  at <ElPopper arrowOffset=5 appendToBody=true autoClose=0  ... > 
  at <ElTooltip content="国际化" effect="dark" > 
  at <ElPopper ref="triggerVnode" visible=false onUpdate:visible=fn  ... > 
  at <ElDropdown trigger="click" class="international right-menu-item hover-effect" onCommand=fn<handleSetLanguage> > 
  at <Index class="right-menu-item hover-effect" > 
  at <Navbar> 
  at <Index onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <App>

解决方案:

svg-icon 组件使用一个元素进行包裹即可

<div>
  <el-tooltip content="国际化" :effect="effect">
    <p>
      <svg-icon icon="language" />
    </p>
  </el-tooltip>
</div>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 在 vue 项目中使用 quill-editor 2.0 更多精彩 更多技术博客,请移步 IT人才终生实训与职业进...
    asing1elife阅读 11,464评论 7 7
  • 日常使用svg作为图标使用已经很常见了,以下为几种使用方式 . file-loader 解析资源文件 最原始的无非...
    z_hboot阅读 7,251评论 0 2
  • 什么是Vue.js Vue.js是目前最火的一个前端框架,React是最流行的一个前端框架,(React除了开发网...
    EEEEsun阅读 3,873评论 0 1
  • 操作元素的 class 列表和内联样式是数据绑定的一个常见需求。因为它们都是 attribute,所以我们可以用 ...
    Prince_0716阅读 8,502评论 1 0
  • 一些概念 Vue Composition API(VCA) 在实现上也其实只是把 Vue 本身就有的响应式系统更显...
    前端精阅读 12,192评论 0 23