Skip to content

Commit 5ed8f86

Browse files
committed
fix: select placeholder support slot #4995
1 parent 3bb093c commit 5ed8f86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/select/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const Select = defineComponent({
5959
'clearIcon',
6060
'dropdownRender',
6161
'option',
62+
'placeholder',
6263
],
6364
setup(props, { attrs, emit, slots, expose }) {
6465
const selectRef = ref();
@@ -120,6 +121,7 @@ const Select = defineComponent({
120121
virtual,
121122
dropdownMatchSelectWidth,
122123
id = formItemContext.id.value,
124+
placeholder = slots.placeholder?.(),
123125
} = props;
124126

125127
const { renderEmpty, getPopupContainer: getContextPopupContainer } = configProvider;
@@ -168,6 +170,7 @@ const Select = defineComponent({
168170
dropdownMatchSelectWidth={dropdownMatchSelectWidth}
169171
{...selectProps}
170172
{...attrs}
173+
placeholder={placeholder}
171174
listHeight={listHeight}
172175
listItemHeight={listItemHeight}
173176
mode={mode.value}

0 commit comments

Comments
 (0)