Vue3 警告:[Vue warn]: Extraneous n

2022-04-03  本文已影响0人  一杆梅子酒

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>
上一篇 下一篇

猜你喜欢

热点阅读