From 36c68ed5981f553e1cc2ba9be4b3341f549052bd Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 13 Jun 2023 15:12:37 +0800 Subject: [PATCH] =?UTF-8?q?BI-128204=20fix:=20=E3=80=906.0.12=E5=8F=91?= =?UTF-8?q?=E6=95=A3=E3=80=91=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E5=8F=8A=E5=86=85=E5=AE=B9=E7=BC=A9=E6=94=BE=E4=B8=8B=EF=BC=8C?= =?UTF-8?q?=E7=BC=A9=E5=B0=8F=E6=B5=8F=E8=A7=88=E5=99=A8=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E8=BF=87=E6=BB=A4=E6=9F=A5=E7=9C=8B=E5=B7=B2=E9=80=89?= =?UTF-8?q?=E4=B8=8B=E6=96=B9=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/base/combination/searcher.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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) {