Browse Source

fix(auto-complete): support `options` slots #4012 (#4072)

pull/4258/head
John 3 years ago committed by GitHub
parent
commit
2e06d38aff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      components/auto-complete/index.tsx

5
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 {

Loading…
Cancel
Save