From c5b9b4d228e2ab61572bc6d4cade857760df257c Mon Sep 17 00:00:00 2001 From: alan Date: Tue, 24 Sep 2019 16:13:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20setLoaded=E6=8B=BF=E5=88=B0=E5=A4=96?= =?UTF-8?q?=E9=9D=A2=E5=8E=BB=E5=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/pages/connection/list/list.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/modules/pages/connection/list/list.ts b/src/modules/pages/connection/list/list.ts index 2b5bb27..6f49bcf 100644 --- a/src/modules/pages/connection/list/list.ts +++ b/src/modules/pages/connection/list/list.ts @@ -33,8 +33,7 @@ export class ConnectionList extends BI.LoadingPane { } render() { - const connectionLength = BI.size(this.model.connections); - if (connectionLength === 0) { + if (BI.size(this.model.connections) === 0) { return { type: CenterAdapt, items: [ @@ -76,9 +75,6 @@ export class ConnectionList extends BI.LoadingPane { type: LoadingBar, ref: (_ref: any) => { this.loadingBar = _ref; - connectionLength > this.model.showItemNum ? - this.loadingBar.setLoaded() : - null; }, handler: () => { this.loadingBar.setLoading(); @@ -89,6 +85,14 @@ export class ConnectionList extends BI.LoadingPane { }; } + created() { + if (this.model.showItemNum) { + BI.size(this.model.connections) > this.model.showItemNum ? + this.loadingBar.setLoaded() : + null; + } + } + private renderList(start = 0) { const itemNum = Math.min(this.model.connections.length, this.model.showItemNum);