(fix) pass class to TreeNodes nodeIcon slot

pull/5453/head
Isabelle Glasmacher 2024-03-21 10:10:04 +01:00
parent 71db0aea00
commit 0db9536243
No known key found for this signature in database
GPG Key ID: 61180CFCC0D53838
2 changed files with 5 additions and 1 deletions

View File

@ -361,6 +361,10 @@ export interface TreeSlots {
* Tree node instance
*/
node: TreeNode;
/**
* Style class of the icon.
*/
class: string;
}): VNode[];
/**
* Custom checkbox icon

View File

@ -32,7 +32,7 @@
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
</template>
</Checkbox>
<component v-if="templates['nodeicon']" :is="templates['nodeicon']" :node="node"></component>
<component v-if="templates['nodeicon']" :is="templates['nodeicon']" :node="node" :class="[cx('nodeIcon')]"></component>
<span v-else :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
<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" />