Browse Source

fix: setLoaded拿到外面去做

qufenxi
alan 5 years ago
parent
commit
c5b9b4d228
  1. 14
      src/modules/pages/connection/list/list.ts

14
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);

Loading…
Cancel
Save