From a759e65ead86ab9de8868b932890ac597c8180c3 Mon Sep 17 00:00:00 2001 From: Sebastian Frank Date: Tue, 29 Aug 2017 21:38:33 +0200 Subject: [PATCH] active navi --- conf/init.json | 5 ++- src/components/sidebar.vue | 69 +++++++++----------------------------- src/main.js | 2 +- 3 files changed, 21 insertions(+), 55 deletions(-) diff --git a/conf/init.json b/conf/init.json index e6bf4ec..5de28fb 100644 --- a/conf/init.json +++ b/conf/init.json @@ -8,7 +8,10 @@ "name": "Login", "to": "/login", "icon": "fa-home", - "content": "" + "content": "", + "show": { + "never": true + } }, { "name": "Dashboard", diff --git a/src/components/sidebar.vue b/src/components/sidebar.vue index 913ad62..b8af8ce 100644 --- a/src/components/sidebar.vue +++ b/src/components/sidebar.vue @@ -4,61 +4,12 @@
@@ -277,6 +228,18 @@ export default { return [ ]; } } + }, + methods: { + showIf(conf) { + console.log(conf); + // show if not configured + if (!conf) { + return true; + } + if (conf.never) { + return false; + } + } } } \ No newline at end of file diff --git a/src/main.js b/src/main.js index 6a919f7..2eb0345 100644 --- a/src/main.js +++ b/src/main.js @@ -177,7 +177,7 @@ Axios.get('conf/init.json') alert('invalid data in init.json'); return; } - const navigation = results.data.navigation.map(({name, to, icon}) => {return {name, to, icon}}); + const navigation = results.data.navigation.map(({name, to, icon, show}) => {return {name, to, icon, show}}); store.commit("setNavigation", navigation);