element ui tree树节点自定义图标

html

js

className自己设置

data(){
    return{
        "treeData": [
             {
                 "id": 1,
                 "label": "group",
                 "className": "group-class tree-icon",
                 "children": [
                      {
                          "id": 11,
                           "label": "child",
                          "className": "child-class tree-icon",
                       }
                  ]
             }
         ]
    }
},
methods: {
        renderContent(h, { node, data, store }) {
            return (
              
                
                {node.label}
              
              );
          }
  }

css 

.tree-icon {
    display:inline-block;
    ...
 }
.child-class{
    //图标设置
}
.group-class {
    //图标设置
}

 

你可能感兴趣的:(element ui tree树节点自定义图标)