diff --git a/packages/fineui/src/base/combination/searcher.js b/packages/fineui/src/base/combination/searcher.js index 5f1fa86c6..bd161c7ef 100644 --- a/packages/fineui/src/base/combination/searcher.js +++ b/packages/fineui/src/base/combination/searcher.js @@ -215,7 +215,8 @@ export class Searcher extends Widget { } _search() { - const { isAutoSearch, adapter, isAutoSync, onSearch } = this.options; + const { isAutoSearch, isAutoSync, onSearch } = this.options; + const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter; const keyword = this.editor.getValue(); if (keyword === "" || this._stop) { return; @@ -335,7 +336,8 @@ export class Searcher extends Widget { } getValue() { - const { isAutoSync, adapter, popup } = this.options; + const { isAutoSync, popup } = this.options; + const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter; if (isAutoSync && adapter && adapter.getValue) { return adapter.getValue(); } @@ -352,7 +354,8 @@ export class Searcher extends Widget { } populate(result, searchResult, keyword) { - const { isAutoSync, adapter } = this.options; + const { isAutoSync } = this.options; + const adapter = isFunction(this.options.adapter) ? this.options.adapter() : this.options.adapter; this._assertPopupView(); this.popupView.populate(...arguments); if (isAutoSync && adapter && adapter.getValue) {