Labelfunction (data. of the props property of the elementUI el-tree component Node) how to use it

labelfunction (data. of the props property of the elementUI el-tree component Node) does not find an example of how to use the official documentation, nor does it explain how to use
http://element.eleme.io/-sharp/zh-.
props label to specify that the node tag is an attribute value of the node object string, function (data, node)

clipboard.png


label: (data, node) = > {

console.log(data, node)
return data.label
},
What is returned in the

function is the displayed content, which is no longer the key value


.

treeProps: {

label:function(data,node){
    console.log(node);
    return data.t.name;
},
isLeaf:'leaf'

},
has no effect, there is no console.log output, what is the matter

all right, I just commented: prop= "treePorps"

Menu