Browse Source

支持自动watch

es6
guy 3 years ago
parent
commit
32685f14ce
  1. 2
      src/core/4.widget.js

2
src/core/4.widget.js

@ -202,7 +202,7 @@
__watch: function (getter, handler, options) { __watch: function (getter, handler, options) {
if (Fix.Model.target) { if (Fix.Model.target) {
this._watchers = this._watchers || []; this._watchers = this._watchers || [];
var watcher = new Fix.Watcher(Fix.Model.target, BI.bind(getter, this), handler || BI.emptyFn, options); var watcher = new Fix.Watcher(Fix.Model.target, BI.bind(getter, this), (handler && BI.bind(handler, this)) || BI.emptyFn, options);
this._watchers.push(watcher); this._watchers.push(watcher);
return watcher.value; return watcher.value;
} else { } else {

Loading…
Cancel
Save