Browse Source

Pull request #2157: 无JIAR任务 整理代码

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

* commit '8b71e71caac7487146062368f3eae64d142702a9':
  整理代码
es6
guy 3 years ago
parent
commit
f6ce6dfaa6
  1. 4
      src/core/3.ob.js
  2. 6
      src/core/4.widget.js

4
src/core/3.ob.js

@ -73,10 +73,10 @@
// 获得一个当前对象的引用 // 获得一个当前对象的引用
_initRef: function () { _initRef: function () {
if (this.options.__ref) { if (this.options.__ref) {
this.options.__ref.call(this, this.$delegate || this); this.options.__ref.call(this, this);
} }
if (this.options.ref) { if (this.options.ref) {
this.options.ref.call(this, this.$delegate || this); this.options.ref.call(this, this);
} }
}, },

6
src/core/4.widget.js

@ -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;
} }

Loading…
Cancel
Save