Refactor #4833
parent
31dde8355a
commit
dd9f38fd35
|
@ -11,7 +11,7 @@ import { VNode } from 'vue';
|
||||||
import { ComponentHooks } from '../basecomponent';
|
import { ComponentHooks } from '../basecomponent';
|
||||||
import { PassThroughOptions } from '../passthrough';
|
import { PassThroughOptions } from '../passthrough';
|
||||||
import { TreeNode } from '../treenode';
|
import { TreeNode } from '../treenode';
|
||||||
import { ClassComponent, GlobalComponentConstructor, PassThrough, HintedString } from '../ts-helpers';
|
import { ClassComponent, GlobalComponentConstructor, HintedString, PassThrough } from '../ts-helpers';
|
||||||
|
|
||||||
export declare type TreePassThroughOptionType<T = any> = TreePassThroughAttributes | ((options: TreePassThroughMethodOptions<T>) => TreePassThroughAttributes | string) | string | null | undefined;
|
export declare type TreePassThroughOptionType<T = any> = TreePassThroughAttributes | ((options: TreePassThroughMethodOptions<T>) => TreePassThroughAttributes | string) | string | null | undefined;
|
||||||
|
|
||||||
|
@ -356,7 +356,7 @@ export interface TreeSlots {
|
||||||
* Custom node icon template.
|
* Custom node icon template.
|
||||||
* @param {Object} scope - togglericon slot's params.
|
* @param {Object} scope - togglericon slot's params.
|
||||||
*/
|
*/
|
||||||
nodeIcon(scope: {
|
nodeicon(scope: {
|
||||||
/**
|
/**
|
||||||
* Tree node instance
|
* Tree node instance
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,12 +32,8 @@
|
||||||
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
|
<component v-else :is="checked ? 'CheckIcon' : partialChecked ? 'MinusIcon' : null" :class="slotProps.class" v-bind="getPTOptions('nodeCheckbox.icon')" />
|
||||||
</template>
|
</template>
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
<template v-if="templates['nodeIcon']">
|
<component v-if="templates['nodeicon']" :is="templates['nodeicon']" :node="node"></component>
|
||||||
<component :is="templates['nodeIcon']" v-bind="getPTOptions('nodeIcon')" :class="cx('nodeIcon')" :node="node"></component>
|
<span v-else :class="[cx('nodeIcon'), node.icon]" v-bind="getPTOptions('nodeIcon')"></span>
|
||||||
</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>
|
<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" />
|
<component v-if="templates[node.type] || templates['default']" :is="templates[node.type] || templates['default']" :node="node" />
|
||||||
<template v-else>{{ label(node) }}</template>
|
<template v-else>{{ label(node) }}</template>
|
||||||
|
|
Loading…
Reference in New Issue