From 2e06d38aff3151d4fd6337ef3c740042d97134a3 Mon Sep 17 00:00:00 2001 From: John Date: Thu, 24 Jun 2021 09:42:27 +0800 Subject: [PATCH] fix(auto-complete): support `options` slots #4012 (#4072) --- components/auto-complete/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index 8844b6b53..4519e2753 100644 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -100,7 +100,10 @@ const AutoComplete = defineComponent({ [`${prefixCls}-show-search`]: true, [`${prefixCls}-auto-complete`]: true, }; - const childArray = getSlot(this, 'dataSource'); + let childArray = getSlot(this, 'dataSource'); + if ('options' in this.$slots) { + childArray = getSlot(this, 'options'); + } if (childArray.length && isSelectOptionOrSelectOptGroup(childArray[0])) { optionChildren = childArray; } else {