Browse Source

Pull request #2554: 无jira任务,beforeRender和beforeInit加上catch

Merge in VISUAL/fineui from ~GUYI/fineui:master to master

* commit 'f799199051c45351600c1d1993e0c22a9835cece':
  无jira任务,console一下
  无jira任务,beforeInit加上catch
  无jira任务,beforeRender加上catch
es6
Guyi 3 years ago
parent
commit
4ebef1bcc6
  1. 10
      src/core/4.widget.js

10
src/core/4.widget.js

@ -147,7 +147,10 @@
self.__async = true;
var beforeRenderResult = (self.options.beforeRender || self.beforeRender).call(self, render);
if (beforeRenderResult instanceof Promise) {
beforeRenderResult.then(render);
beforeRenderResult.then(render).catch(function (e) {
_global.console && console.error(e);
render();
});
}
} else {
self._render();
@ -159,7 +162,10 @@
this.__asking = true;
var beforeInitResult = (this.options.beforeInit || this.beforeInit).call(this, init);
if (beforeInitResult instanceof Promise) {
beforeInitResult.then(init);
beforeInitResult.then(init).catch(function (e) {
_global.console && console.error(e);
init();
});
}
} else {
init();

Loading…
Cancel
Save