Browse Source

Merge remote-tracking branch 'origin/master'

es6
imp 3 years ago
parent
commit
89a3dd58a2
  1. 3
      examples/dev.html
  2. 4
      src/core/6.inject.js

3
examples/dev.html

@ -17,11 +17,14 @@
}); });
BI.module("my.module", { BI.module("my.module", {
// version不设置的话默认就用接口的version作为判断条件
version: "1.0",
components: { components: {
"demo.parent": "1.0" "demo.parent": "1.0"
} }
}) })
// 主线代码里加这个
BI.config("bi.provider.system", function (provider) { BI.config("bi.provider.system", function (provider) {
provider.addDependencies({ provider.addDependencies({
"my.module": { "my.module": {

4
src/core/6.inject.js

@ -108,11 +108,11 @@
var module = modules[i]; var module = modules[i];
if (module && dependencies[module.moduleId] && module.version === version) { if (module && dependencies[module.moduleId] && module.version === version) {
var minVersion = dependencies[module.moduleId].minVersion, maxVersion = dependencies[module.moduleId].maxVersion; var minVersion = dependencies[module.moduleId].minVersion, maxVersion = dependencies[module.moduleId].maxVersion;
if (minVersion && module.version < minVersion){ if (minVersion && (moduleInjection[module.moduleId].version || version) < minVersion){
findVersion = true; findVersion = true;
break; break;
} }
if(maxVersion && module.version > maxVersion){ if(maxVersion && (moduleInjection[module.moduleId].version || version) > maxVersion){
findVersion = true; findVersion = true;
break; break;
} }

Loading…
Cancel
Save