Fixed #6513 - Tree: new header and footer slots
parent
9d4588308d
commit
da7b4fb3f6
|
@ -461,6 +461,42 @@ export interface TreeSlots {
|
|||
*/
|
||||
partialChecked: boolean;
|
||||
}): 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.
|
||||
* @todo
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
</InputIcon>
|
||||
</IconField>
|
||||
<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')">
|
||||
<TreeNode
|
||||
v-for="(node, index) of valueToRender"
|
||||
|
@ -37,6 +38,7 @@
|
|||
:pt="pt"
|
||||
></TreeNode>
|
||||
</ul>
|
||||
<slot name="footer" :value="value" :expandedKeys="expandedKeys" :selectionKeys="selectionKeys" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue