Browse Source

支持BI.useContext

es6
guy 3 years ago
parent
commit
b9bdc625aa
  1. 14
      src/core/4.widget.js

14
src/core/4.widget.js

@ -772,7 +772,7 @@
return BI.Model.target; return BI.Model.target;
}; };
BI.watch = function (vm, watch, handler, options) { BI.watch = function (vm, watch, handler) {
if (BI.Widget.current) { if (BI.Widget.current) {
options = options || {}; options = options || {};
if (vm instanceof BI.Model) { if (vm instanceof BI.Model) {
@ -786,14 +786,14 @@
var handler = watch[key]; var handler = watch[key];
if (BI.isArray(handler)) { if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) { for (var i = 0; i < handler.length; i++) {
BI.Widget.current._watchers.push(Fix.watch(vm.model, key, handler, BI.extend(options, { BI.Widget.current._watchers.push(Fix.watch(vm.model, key, handler, {
store: vm.store store: vm
}))); }));
} }
} else { } else {
BI.Widget.current._watchers.push(Fix.watch(vm.model, key, handler, BI.extend(options, { BI.Widget.current._watchers.push(Fix.watch(vm.model, key, handler, {
store: vm.store store: vm
}))); }));
} }
} }
} else { } else {

Loading…
Cancel
Save