|
|
@ -50,13 +50,13 @@ |
|
|
|
|
|
|
|
|
|
|
|
// 覆盖父类的_constructor方法,widget不走ob的生命周期
|
|
|
|
// 覆盖父类的_constructor方法,widget不走ob的生命周期
|
|
|
|
_constructed: function () { |
|
|
|
_constructed: function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
if (this.setup) { |
|
|
|
if (this.setup) { |
|
|
|
pushTarget(this); |
|
|
|
pushTarget(this); |
|
|
|
var delegate = this.setup(this.options); |
|
|
|
var delegate = this.setup(this.options); |
|
|
|
if (BI.isPlainObject(delegate)) { |
|
|
|
if (BI.isPlainObject(delegate)) { |
|
|
|
this.render = delegate.render; |
|
|
|
// 如果setup返回一个json,即对外暴露的方法
|
|
|
|
// setup返回一个json,即对外暴露的方法
|
|
|
|
BI.extend(this, delegate); |
|
|
|
this.$delegate = delegate; |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.render = delegate; |
|
|
|
this.render = delegate; |
|
|
|
} |
|
|
|
} |
|
|
|