element plus中tree組件的使用以及自定義圖標


<el-tree
      :data="data"
      node-key="id"
      ref="tree"
      icon-class="el-icon-share"
      :props="defaultProps">
      <template #default="scope">
        <div class="custom-node">
          <i class="el-icon-edit"></i>
          <span>{{scope.node.label}}</span>
        </div>
      </template>
    </el-tree>

通過slot插槽可以自定義節點內容,如果想替換圖標,需要自定義圖標並把之前的圖標隱藏


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM