dynamic profile nav
This commit is contained in:
@@ -12,18 +12,12 @@
|
||||
</a>
|
||||
<nav class="user_menu">
|
||||
<ul>
|
||||
<li><a href="#">
|
||||
<i class="icon icon-color-wand" aria-hidden="true"></i>
|
||||
<div class="title">
|
||||
<router-link :to="'/users/' + loginID">Profil anpassen</router-link>
|
||||
</div>
|
||||
</a></li>
|
||||
<li><a href="#">
|
||||
<i class="icon icon-log-out" aria-hidden="true"></i>
|
||||
<div class="title">
|
||||
<router-link to="/logout">Logout</router-link>
|
||||
</div>
|
||||
</a></li>
|
||||
<router-link tag="li" v-for="(item, i) in items" :key="i" v-if="showIf(item.show)" :to="item.to" active-class="active" exact>
|
||||
<a>
|
||||
<i :class="['icon', item.icon]"></i>
|
||||
<div class="title">{{ item.name }}</div>
|
||||
</a>
|
||||
</router-link>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -33,6 +27,9 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "Topbar",
|
||||
props: [
|
||||
"items"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
@@ -67,6 +64,15 @@ export default {
|
||||
methods: {
|
||||
toggleMenu() {
|
||||
this.$refs.user_profile.classList.toggle("open");
|
||||
},
|
||||
showIf(conf) {
|
||||
// show if not configured
|
||||
if (!conf) {
|
||||
return true;
|
||||
}
|
||||
if (conf.never) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user