ElementUI el-tree 树形控件给节点添加图标

ElementUI el-tree 树形控件给节点添加图标

原文链接:https://www.cnblogs.com/cupid10/p/13820823.html

TreeData为后端获取到的数据

 <el-tree
          :expand-on-click-node="false"
          style="width:180px"
          class="tree filter-tree"
          :indent="0"
          :data="TreeData"
          node-key="id"
          default-expand-all
          :props="defaultProps"
          @node-click="handleNodeClick"
        >
          <span class="custom-tree-node" slot-scope="{ data }">
            <span>
              <i :class="data.icon" style="font-size:20px color:red"></i
              >{{ data.modulename }}
            </span>
          </span>
        </el-tree>

 

posted @ 2020-12-03 16:03  奔跑的太阳花  阅读(4362)  评论(0编辑  收藏  举报