summaryrefslogtreecommitdiffstats
path: root/webapp/src/router.js
diff options
context:
space:
mode:
authorUdo Walter2018-08-03 23:51:11 +0200
committerUdo Walter2018-08-03 23:51:11 +0200
commit344a0502ab3800e69712bff15d4026550d50ab76 (patch)
treefd6b9c771fc89be5524eac25f2a5667eebb05faf /webapp/src/router.js
parent[groups] icon fix (diff)
downloadbas-344a0502ab3800e69712bff15d4026550d50ab76.tar.gz
bas-344a0502ab3800e69712bff15d4026550d50ab76.tar.xz
bas-344a0502ab3800e69712bff15d4026550d50ab76.zip
[webapp] everythiing configurable (dashboardmodule, stores and global i18n messages is now in the config folder; router rework: modules can now set their own subroutes
Diffstat (limited to 'webapp/src/router.js')
-rw-r--r--webapp/src/router.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/webapp/src/router.js b/webapp/src/router.js
index be287cf..1c9484a 100644
--- a/webapp/src/router.js
+++ b/webapp/src/router.js
@@ -2,9 +2,20 @@ import Vue from 'vue'
import Router from 'vue-router'
import LoginPage from '@/components/LoginPage'
import DashboardPage from '@/components/DashboardPage'
+import dashboardModules from '@/config/dashboard'
Vue.use(Router)
+function setChildren (modules) {
+ modules.forEach(module => {
+ if (module.component && module.component.routes) {
+ module.children = module.component.routes()
+ setChildren(module.children)
+ }
+ })
+ return modules
+}
+
var router = new Router({
routes: [
{
@@ -16,7 +27,7 @@ var router = new Router({
path: '/dashboard',
name: 'Dashboard',
component: DashboardPage,
- children: DashboardPage.dashboardModules.concat(DashboardPage.hiddenModules)
+ children: setChildren(dashboardModules.concat(DashboardPage.routes()))
},
{
path: '*',