美文网首页
Vue3 警告:[Vue warn]: Extraneous n

Vue3 警告:[Vue warn]: Extraneous n

作者: 一杆梅子酒 | 来源:发表于2022-04-03 22:35 被阅读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>
    

    相关文章

      网友评论

          本文标题:Vue3 警告:[Vue warn]: Extraneous n

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