fix: select placeholder support slot #4995

pull/4996/head
tangjinzhou 2021-12-07 22:23:36 +08:00
parent 3bb093cb23
commit 5ed8f8686d
1 changed files with 3 additions and 0 deletions

View File

@ -59,6 +59,7 @@ const Select = defineComponent({
'clearIcon', 'clearIcon',
'dropdownRender', 'dropdownRender',
'option', 'option',
'placeholder',
], ],
setup(props, { attrs, emit, slots, expose }) { setup(props, { attrs, emit, slots, expose }) {
const selectRef = ref(); const selectRef = ref();
@ -120,6 +121,7 @@ const Select = defineComponent({
virtual, virtual,
dropdownMatchSelectWidth, dropdownMatchSelectWidth,
id = formItemContext.id.value, id = formItemContext.id.value,
placeholder = slots.placeholder?.(),
} = props; } = props;
const { renderEmpty, getPopupContainer: getContextPopupContainer } = configProvider; const { renderEmpty, getPopupContainer: getContextPopupContainer } = configProvider;
@ -168,6 +170,7 @@ const Select = defineComponent({
dropdownMatchSelectWidth={dropdownMatchSelectWidth} dropdownMatchSelectWidth={dropdownMatchSelectWidth}
{...selectProps} {...selectProps}
{...attrs} {...attrs}
placeholder={placeholder}
listHeight={listHeight} listHeight={listHeight}
listItemHeight={listItemHeight} listItemHeight={listItemHeight}
mode={mode.value} mode={mode.value}