Skip to content

Commit 5fe1fcc

Browse files
committed
fix(auto-complete): support options slots vueComponent#4012
1 parent b51f25f commit 5fe1fcc

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
@@ -94,7 +94,10 @@ const AutoComplete = defineComponent({
9494
[`${prefixCls}-show-search`]: true,
9595
[`${prefixCls}-auto-complete`]: true,
9696
};
97-
const childArray = getSlot(this, 'dataSource');
97+
let childArray = getSlot(this, 'dataSource');
98+
if ('options' in this.$slots) {
99+
childArray = getSlot(this, 'options');
100+
}
98101
if (childArray.length && isSelectOptionOrSelectOptGroup(childArray[0])) {
99102
optionChildren = childArray;
100103
} else {

0 commit comments

Comments
 (0)