diff --git a/examples/dev.html b/examples/dev.html
index b882d0876..2f9a55f7b 100644
--- a/examples/dev.html
+++ b/examples/dev.html
@@ -17,11 +17,14 @@
});
BI.module("my.module", {
+ // version不设置的话默认就用接口的version作为判断条件
+ version: "1.0",
components: {
"demo.parent": "1.0"
}
})
+ // 主线代码里加这个
BI.config("bi.provider.system", function (provider) {
provider.addDependencies({
"my.module": {
diff --git a/src/core/6.inject.js b/src/core/6.inject.js
index 0f9b04fc6..b352833f7 100644
--- a/src/core/6.inject.js
+++ b/src/core/6.inject.js
@@ -109,11 +109,11 @@
var module = modules[i];
if (module && dependencies[module.moduleId] && module.version === version) {
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;
break;
}
- if(maxVersion && module.version > maxVersion){
+ if(maxVersion && (moduleInjection[module.moduleId].version || version) > maxVersion){
findVersion = true;
break;
}