Browse Source

整理代码

es6
guy 3 years ago
parent
commit
11c1cd57ea
  1. 9
      examples/插件设计.html
  2. 2
      src/core/6.inject.js

9
examples/插件设计.html

@ -11,7 +11,10 @@
<script>
BI.config("demo.parent", function (config){
console.log("123");
return config;
return {
type: "bi.button",
text: "被替换的组件"
};
}, {
version: "1.0"
});
@ -22,7 +25,7 @@
components: {
"demo.parent": "1.0"
}
})
});
// 主线代码里加这个
BI.config("bi.provider.system", function (provider) {
@ -32,7 +35,7 @@
maxVersion: "4.0"
}
})
})
});
</script>
<script>
var Model = BI.inherit(Fix.Model, {

2
src/core/6.inject.js

@ -95,7 +95,7 @@
if (modules && version) {
var findVersion = false;
for (var j = 0; j < modules.length; j++) {
var module = modules[i];
var module = modules[j];
if (module && dependencies[module.moduleId] && module.version === version) {
var minVersion = dependencies[module.moduleId].minVersion,
maxVersion = dependencies[module.moduleId].maxVersion;

Loading…
Cancel
Save