|
|
@ -10,26 +10,34 @@ BI.$(function () { |
|
|
|
var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG); |
|
|
|
var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG); |
|
|
|
|
|
|
|
|
|
|
|
var routes = [{ |
|
|
|
var routes = [{ |
|
|
|
path: '/', |
|
|
|
path: "/", |
|
|
|
component: function () { |
|
|
|
component: function () { |
|
|
|
return Promise.resolve({ |
|
|
|
return Promise.resolve({ |
|
|
|
type: "demo.face" |
|
|
|
type: "demo.face" |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}]; |
|
|
|
}, { |
|
|
|
|
|
|
|
name: "component", |
|
|
|
BI.Tree.traversal(tree, function (index, node) { |
|
|
|
path: "/component/:componentId", |
|
|
|
if (!node.children || BI.isEmptyArray(node.children)) { |
|
|
|
|
|
|
|
routes.push({ |
|
|
|
|
|
|
|
path: '/' + node.text, |
|
|
|
|
|
|
|
component: function () { |
|
|
|
component: function () { |
|
|
|
return Promise.resolve({ |
|
|
|
return Promise.resolve({ |
|
|
|
type: node.value |
|
|
|
type: "demo.router" |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// BI.Tree.traversal(tree, function (index, node) {
|
|
|
|
|
|
|
|
// if (!node.children || BI.isEmptyArray(node.children)) {
|
|
|
|
|
|
|
|
// routes.push({
|
|
|
|
|
|
|
|
// path: "/",
|
|
|
|
|
|
|
|
// component: function () {
|
|
|
|
|
|
|
|
// return Promise.resolve({
|
|
|
|
|
|
|
|
// type: node.value
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
// var AppRouter = BI.inherit(BI.Router, obj);
|
|
|
|
// var AppRouter = BI.inherit(BI.Router, obj);
|
|
|
|
// new AppRouter;
|
|
|
|
// new AppRouter;
|
|
|
@ -49,7 +57,7 @@ BI.$(function () { |
|
|
|
console.log(_ref); |
|
|
|
console.log(_ref); |
|
|
|
ref = _ref; |
|
|
|
ref = _ref; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|