Fixed #6504 - CascadeSelect: new header and footer slots

pull/6275/head^2
tugcekucukoglu 2024-10-01 12:43:38 +03:00
parent 920765f171
commit 58a750d656
2 changed files with 10 additions and 0 deletions

View File

@ -502,6 +502,14 @@ export interface CascadeSelectSlots {
*/ */
class: string; class: string;
}): VNode[]; }): VNode[];
/**
* Custom header template.
*/
header(): VNode[];
/**
* Custom footer template.
*/
footer(): VNode[];
} }
/** /**

View File

@ -53,6 +53,7 @@
@keydown="onOverlayKeyDown" @keydown="onOverlayKeyDown"
v-bind="{ ...panelProps, ...overlayProps, ...ptm('overlay') }" v-bind="{ ...panelProps, ...overlayProps, ...ptm('overlay') }"
> >
<slot name="header" />
<div :class="cx('listContainer')" v-bind="ptm('listContainer')"> <div :class="cx('listContainer')" v-bind="ptm('listContainer')">
<CascadeSelectSub <CascadeSelectSub
:id="id + '_tree'" :id="id + '_tree'"
@ -79,6 +80,7 @@
<span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenSelectedMessage')" :data-p-hidden-accessible="true"> <span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenSelectedMessage')" :data-p-hidden-accessible="true">
{{ selectedMessageText }} {{ selectedMessageText }}
</span> </span>
<slot name="footer" />
</div> </div>
</transition> </transition>
</Portal> </Portal>