Refactor #4274 - For MultiSelect

pull/3943/head^2
Tuğçe Küçükoğlu 2023-08-16 09:40:20 +03:00
parent 07dae2e611
commit 2c47b9447a
2 changed files with 9 additions and 3 deletions

View File

@ -659,9 +659,15 @@ export interface MultiSelectSlots {
*/
class: string;
/**
* Remove token icon function.
* Item of the token.
*/
onClick: void;
item: any;
/**
* Remove token icon function.
* @param {Event} event - Browser event
* @param {any} item - Item
*/
onClick(event: Event, item: any): void;
}): VNode[];
/**
* Custom header checkbox icon template.

View File

@ -33,7 +33,7 @@
<slot name="chip" :value="item">
<span :class="cx('tokenLabel')" v-bind="ptm('tokenLabel')">{{ getLabelByValue(item) }}</span>
</slot>
<slot v-if="!disabled" name="removetokenicon" :class="cx('removeTokenIcon')" :onClick="(event) => removeOption(event, item)">
<slot v-if="!disabled" name="removetokenicon" :class="cx('removeTokenIcon')" :item="item" :onClick="(event) => removeOption(event, item)">
<span v-if="removeTokenIcon" :class="[cx('removeTokenIcon'), removeTokenIcon]" @click.stop="removeOption($event, item)" v-bind="ptm('removeTokenIcon')" />
<TimesCircleIcon v-else :class="cx('removeTokenIcon')" @click.stop="removeOption($event, item)" v-bind="ptm('removeTokenIcon')" />
</slot>