forked from fanruan/fineui
Browse Source
* commit '6749f2958ecd77c6b9d2ae0aba46b79d3369e777': update update update 抽出beforeInit相关逻辑,在LoadingPane中重写loading情况下的render逻辑 update 去掉pane中无效方法 无JIRA任务 获取数据后渲染页面loading效果master
windy
6 years ago
20 changed files with 347 additions and 172 deletions
@ -0,0 +1,29 @@
|
||||
/** |
||||
* author: young |
||||
* createdDate: 2018/11/30 |
||||
* description: |
||||
*/ |
||||
!(function () { |
||||
var Pane = BI.inherit(BI.LoadingPane, { |
||||
props: { |
||||
|
||||
}, |
||||
|
||||
render: function () { |
||||
return { |
||||
type: "bi.center_adapt", |
||||
items: [{ |
||||
type: "bi.label", |
||||
text: "this is pane center" |
||||
}] |
||||
}; |
||||
}, |
||||
|
||||
beforeInit: function (callback) { |
||||
setTimeout(function () { |
||||
callback(); |
||||
}, 3000); |
||||
} |
||||
}); |
||||
BI.shortcut("demo.pane", Pane); |
||||
})(); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,31 @@
|
||||
/** |
||||
* author: young |
||||
* createdDate: 2018/12/18 |
||||
* description: |
||||
*/ |
||||
BI.LoadingPane = BI.inherit(BI.Pane, { |
||||
_mount: function () { |
||||
var isMounted = BI.Pane.superclass._mount.apply(this, arguments); |
||||
if (isMounted) { |
||||
if (this.beforeInit) { |
||||
this.__asking = true; |
||||
this.loading(); |
||||
this.beforeInit(BI.bind(this.__loaded, this)); |
||||
} |
||||
} |
||||
}, |
||||
|
||||
_initRender: function () { |
||||
if (this.beforeInit) { |
||||
this.__async = true; |
||||
} else { |
||||
this._render(); |
||||
} |
||||
}, |
||||
|
||||
__loaded: function () { |
||||
this.__asking = false; |
||||
this.loaded(); |
||||
this._render(); |
||||
} |
||||
}); |
Loading…
Reference in new issue