Closed ErikVerheul closed 5 years ago
Problem solved after making the conditions only dependent of the node data. Like this:
<template slot="title" slot-scope="{ node }">
<span class="item-icon">
<i v-if="node.isLeaf && node.data.subtype == 0">
<font-awesome-icon icon="file" />
</i>
<i v-if="node.isLeaf && node.data.subtype == 1">
<font-awesome-icon icon="hourglass-start" />
</i>
<i class="colorRed" v-if="node.isLeaf && node.data.subtype == 2">
<font-awesome-icon icon="bug" />
</i>
<i v-if="!node.isLeaf">
<font-awesome-icon icon="folder" />
</i>
</span>
{{ node.title }}
</template>
So far your component worked great for me. However changing the icon of individual nodes seems impossible. If you change one you change them all. In the code snippet below I added two more icons depending on some conditions. When I click on the node with the bug icon all leaf items get the bug icon. Would be great if the next release supports changing individual nodes, either in the slot or via a method in JavaScript.
Thank you for your good work, Erik