Browse Source

支持BI.useContext

es6
guy 3 years ago
parent
commit
255d9dfc20
  1. 13
      src/core/4.widget.js

13
src/core/4.widget.js

@ -768,7 +768,18 @@
} }
}; };
BI.useContext = function () { BI.useContext = function (inject) {
if (BI.Model.target) {
var p = BI.Model.target;
if (inject) {
while (p) {
if (p.$$context && inject in p.$$context) {
return p;
}
p = p._parent;
}
}
}
return BI.Model.target; return BI.Model.target;
}; };

Loading…
Cancel
Save