feat: Tree - add slot for nodeIcon

closes #4833
This commit is contained in:
Isabelle Glasmacher 2024-02-26 12:52:36 +01:00
parent a31f1a0c8f
commit d6d58557ef
No known key found for this signature in database
GPG key ID: 61180CFCC0D53838
3 changed files with 43 additions and 1 deletions

View file

@ -32,7 +32,12 @@
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
</template>
</Checkbox>
<span :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
<template v-if="templates['nodeIcon']">
<component :is="templates['nodeIcon']" v-bind="getPTOptions('nodeIcon')" :class="cx('nodeIcon')" :node="node"></component>
</template>
<template v-else>
<span :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
</template>
<span :class="cx('label')" v-bind="getPTOptions('label')" @keydown.stop>
<component v-if="templates[node.type] || templates['default']" :is="templates[node.type] || templates['default']" :node="node" />
<template v-else>{{ label(node) }}</template>