Skip to content

Commit

Permalink
feat(Experimental/Select): new slot: new-item-text
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Sep 7, 2023
1 parent 6af9efb commit 5db2e54
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/select/src/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const props = withDefaults(
emptyText?: string;
searchBy?: string;
selectionItemProps?: InstanceType<typeof VBadge>['$props'];
displayValue?: (item: any) => string;
displayValue?: (item: T) => string;
placement?: Placement;
offset?: number;
shift?: boolean | number;
Expand Down Expand Up @@ -265,6 +265,7 @@ defineSlots<{
open: boolean;
}) => any;
'check-icon'?: (props: {selected: boolean; icon: string}) => any;
'new-item-text'?: (props: {item: T}) => any;
}>();
</script>

Expand Down Expand Up @@ -532,7 +533,9 @@ defineSlots<{
</slot>
</div>
<div class="v-select-option-text">
Create "{{ newItem[itemText] }}"
<slot name="new-item-text" v-bind="{item: newItem}">
Create "{{ newItem[itemText] }}"
</slot>
</div>
</div>
</ComboboxOption>
Expand Down

0 comments on commit 5db2e54

Please sign in to comment.