Browse Source

支持自动watch

es6
guy 3 years ago
parent
commit
20438d2011
  1. 5
      src/core/4.widget.js

5
src/core/4.widget.js

@ -200,9 +200,12 @@
},
__watch: function (getter, handler, options) {
var self = this;
if (_global.Fix) {
this._watchers = this._watchers || [];
var watcher = new Fix.Watcher(null, BI.bind(getter, this), (handler && BI.bind(handler, this)) || BI.emptyFn, options);
var watcher = new Fix.Watcher(null, BI.bind(getter, this), (handler && function () {
handler.call(self, self);
}) || BI.emptyFn, options);
this._watchers.push(watcher);
return watcher.value;
} else {

Loading…
Cancel
Save