Fixed #6513 - Tree: new header and footer slots
parent
9d4588308d
commit
da7b4fb3f6
|
@ -461,6 +461,42 @@ export interface TreeSlots {
|
||||||
*/
|
*/
|
||||||
partialChecked: boolean;
|
partialChecked: boolean;
|
||||||
}): VNode[];
|
}): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom header
|
||||||
|
* @param {Object} scope - header slot's params.
|
||||||
|
*/
|
||||||
|
header(scope: {
|
||||||
|
/**
|
||||||
|
* Current value
|
||||||
|
*/
|
||||||
|
value: TreeNode[];
|
||||||
|
/**
|
||||||
|
* Current expanded key
|
||||||
|
*/
|
||||||
|
expandedKeys: TreeExpandedKeys;
|
||||||
|
/**
|
||||||
|
* Current selected keys
|
||||||
|
*/
|
||||||
|
selectionKeys: TreeSelectionKeys;
|
||||||
|
}): VNode[];
|
||||||
|
/**
|
||||||
|
* Custom footer
|
||||||
|
* @param {Object} scope - footer slot's params.
|
||||||
|
*/
|
||||||
|
footer(scope: {
|
||||||
|
/**
|
||||||
|
* Current value
|
||||||
|
*/
|
||||||
|
value: TreeNode[];
|
||||||
|
/**
|
||||||
|
* Current expanded key
|
||||||
|
*/
|
||||||
|
expandedKeys: TreeExpandedKeys;
|
||||||
|
/**
|
||||||
|
* Current selected keys
|
||||||
|
*/
|
||||||
|
selectionKeys: TreeSelectionKeys;
|
||||||
|
}): VNode[];
|
||||||
/**
|
/**
|
||||||
* Optional slots.
|
* Optional slots.
|
||||||
* @todo
|
* @todo
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
</InputIcon>
|
</InputIcon>
|
||||||
</IconField>
|
</IconField>
|
||||||
<div :class="cx('wrapper')" :style="{ maxHeight: scrollHeight }" v-bind="ptm('wrapper')">
|
<div :class="cx('wrapper')" :style="{ maxHeight: scrollHeight }" v-bind="ptm('wrapper')">
|
||||||
|
<slot name="header" :value="value" :expandedKeys="expandedKeys" :selectionKeys="selectionKeys" />
|
||||||
<ul :class="cx('rootChildren')" role="tree" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('rootChildren')">
|
<ul :class="cx('rootChildren')" role="tree" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('rootChildren')">
|
||||||
<TreeNode
|
<TreeNode
|
||||||
v-for="(node, index) of valueToRender"
|
v-for="(node, index) of valueToRender"
|
||||||
|
@ -37,6 +38,7 @@
|
||||||
:pt="pt"
|
:pt="pt"
|
||||||
></TreeNode>
|
></TreeNode>
|
||||||
</ul>
|
</ul>
|
||||||
|
<slot name="footer" :value="value" :expandedKeys="expandedKeys" :selectionKeys="selectionKeys" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue