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

2
src/core/6.inject.js

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

Loading…
Cancel
Save