SplitButton icon sot updates

pull/4030/head
Tuğçe Küçükoğlu 2023-06-06 11:14:14 +03:00
parent 1f961e0a6e
commit ebe3ac809c
2 changed files with 14 additions and 4 deletions

View File

@ -181,11 +181,21 @@ export interface SplitButtonSlots {
/**
* Custom menu button icon template.
*/
icon(): VNode[];
icon(scope: {
/**
* Style class of the icon.
*/
class: string;
}): VNode[];
/**
* Custom menu button icon template.
*/
menubuttonicon(): VNode[];
menubuttonicon(scope: {
/**
* Style class of the icon.
*/
class: string;
}): VNode[];
}
/**

View File

@ -3,7 +3,7 @@
<slot>
<PVSButton type="button" :class="cx('button')" :label="label" :disabled="disabled" :aria-label="label" @click="onDefaultButtonClick" :unstyled="unstyled" :pt="ptm('button')" v-bind="buttonProps">
<template #icon="slotProps">
<slot name="icon">
<slot name="icon" :class="slotProps.class">
<span :class="[icon, slotProps.class]" v-bind="ptm('button')['icon']" />
</slot>
</template>
@ -24,7 +24,7 @@
v-bind="menuButtonProps"
>
<template #icon="slotProps">
<slot name="menubuttonicon">
<slot name="menubuttonicon" :class="slotProps.class">
<component :is="menuButtonIcon ? 'span' : 'ChevronDownIcon'" :class="[menuButtonIcon, slotProps.class]" v-bind="ptm('menuButton')['icon']" />
</slot>
</template>