fineui是帆软报表和BI产品线所使用的前端框架。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.3 KiB

7 years ago
Demo = {
version: 1.0
};
5 years ago
BI.$(function () {
8 years ago
var ref;
BI.each(Demo.CONFIG, function (index, item) {
!item.id && (item.id = item.value || item.text);
});
var tree = BI.Tree.transformToTreeFormat(Demo.CONFIG);
3 years ago
var routes = [{
path: '/',
3 years ago
component: function(){
return Promise.resolve({
type: "demo.face"
})
}
3 years ago
}];
BI.Tree.traversal(tree, function (index, node) {
if (!node.children || BI.isEmptyArray(node.children)) {
3 years ago
routes.push({
path: '/' + node.text,
3 years ago
component: function(){
return Promise.resolve({
type: node.value
})
3 years ago
}
3 years ago
});
7 years ago
}
8 years ago
});
3 years ago
// var AppRouter = BI.inherit(BI.Router, obj);
// new AppRouter;
// BI.history.start();
BI.createWidget({
3 years ago
type: "bi.router",
ref: function (_ref) {
3 years ago
BI.$router = _ref.$router;
},
3 years ago
element: "#wrapper",
routes: routes,
render: function () {
return {
type: "demo.main",
ref: function (_ref) {
console.log(_ref);
ref = _ref;
}
}
3 years ago
}
});
3 years ago
});