Skip to content

Commit 2e06d38

Browse files
authored
fix(auto-complete): support options slots #4012 (#4072)
1 parent 8d8f940 commit 2e06d38

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/auto-complete/index.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ const AutoComplete = defineComponent({
100100
[`${prefixCls}-show-search`]: true,
101101
[`${prefixCls}-auto-complete`]: true,
102102
};
103-
const childArray = getSlot(this, 'dataSource');
103+
let childArray = getSlot(this, 'dataSource');
104+
if ('options' in this.$slots) {
105+
childArray = getSlot(this, 'options');
106+
}
104107
if (childArray.length && isSelectOptionOrSelectOptGroup(childArray[0])) {
105108
optionChildren = childArray;
106109
} else {

0 commit comments

Comments
 (0)