From a837ee42085580105fb11be9082fe5f7cae5d13f Mon Sep 17 00:00:00 2001 From: Ade Novid Date: Thu, 22 Feb 2024 10:51:11 +0700 Subject: [PATCH 1/5] feat(select): add `keyword` in `empty` slot's scope --- src/components/select/Select.vue | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/components/select/Select.vue b/src/components/select/Select.vue index 7df16026f6..7affa8e316 100644 --- a/src/components/select/Select.vue +++ b/src/components/select/Select.vue @@ -89,7 +89,9 @@
- + {{ emptyText }}
@@ -168,6 +170,7 @@ import IconLoading from '../spinner/SpinnerRing.vue' import type { PropType, HTMLAttributes, + VNode, } from 'vue-demi' import { computed, @@ -459,6 +462,23 @@ defineExpose({ menuEl, toggle, }) + +defineSlots<{ + 'activator'(props: { + isOpen: boolean, + open: () => void, + close: () => void, + toggle: () => void, + }): VNode[], + 'selected'(props: { item: unknown, multiple: boolean }): VNode[], + 'placeholder'(): VNode[], + 'empty'(props: { keyword: string }): VNode[], + 'option'(props: { + item: SelectItem, + isSelected: boolean, + }): VNode[], + 'loading'(): VNode[], +}>()