vuejs-tree
vuejs-tree copied to clipboard
Adding custom html to node based on property
I would like to add custom html to node based on a property, such as depth. I do not see a way to do this currently, am I missing something?
The purpose for this is to have different icons as I drill down into my hierarchy.
Thanks!
Hi, I have the same issue, I need to change each icon individually for each node, depending of some variables or attributes. is this possible with styles like CSS or something like that? Thanks!
Hello,
That's not possible via the tree config (and not plan yet).
You could have something like this: selectIcon: { class: this.myCssIconFunction() }
but i don't think you can access the node directly if it's not given as a param
Ok, thanks for the answer, just for the record, there is a way to change the content using CSS, with the pseudo-selector call :before, inside the <li>
selector, because the icon itselft it's a unicode symbol.