diff --git a/api-generator/components/chip.js b/api-generator/components/chip.js index abf3096df..1f4c4abca 100644 --- a/api-generator/components/chip.js +++ b/api-generator/components/chip.js @@ -45,11 +45,19 @@ const ChipEvents = [ } ]; +const ChipSlots = [ + { + name: 'removeicon', + description: 'Custom remove icon template of chip component.' + } +]; + module.exports = { chip: { name: 'Chip', description: 'Chip represents entities using icons, labels and images', props: ChipProps, - events: ChipEvents + events: ChipEvents, + slots: ChipSlots } }; diff --git a/components/lib/chip/Chip.d.ts b/components/lib/chip/Chip.d.ts index b717e3243..2b8204b13 100644 --- a/components/lib/chip/Chip.d.ts +++ b/components/lib/chip/Chip.d.ts @@ -33,7 +33,6 @@ export interface ChipProps { removable?: boolean; /** * Icon of the remove element. - * @defaultValue pi pi-times-circle */ removeIcon?: string; } @@ -46,6 +45,20 @@ export interface ChipSlots { * Content can easily be customized with the default slot instead of using the built-in modes. */ default(): VNode[]; + /** + * Custom remove icon template of chip component. + * @param {Object} scope - remove icon slot's params. + */ + removeicon(scope: { + /** + * Remove icon click event + */ + click(): void; + /** + * Remove icon keydown event + */ + keydown(): void; + }): VNode[]; } /** diff --git a/components/lib/chip/Chip.vue b/components/lib/chip/Chip.vue index 8c15e20a1..b80dcb107 100644 --- a/components/lib/chip/Chip.vue +++ b/components/lib/chip/Chip.vue @@ -5,11 +5,14 @@
{{ label }}
- + + +