#12 style(Navbar): add icions and separete admin actions.
This commit is contained in:
parent
5860411753
commit
d89b79bfd0
@ -12,11 +12,30 @@
|
|||||||
<v-navigation-drawer v-model="drawer"
|
<v-navigation-drawer v-model="drawer"
|
||||||
:location="$vuetify.display.mobile ? 'bottom' : undefined"
|
:location="$vuetify.display.mobile ? 'bottom' : undefined"
|
||||||
temporary>
|
temporary>
|
||||||
<v-list>
|
<v-list
|
||||||
<v-list-item v-for="item in menuItems" :key="item.title" @click="navigate(item.route)">
|
density="compact"
|
||||||
<v-list-item-title>{{ item.title }}</v-list-item-title>
|
nav
|
||||||
</v-list-item>
|
>
|
||||||
</v-list>
|
<v-list-item
|
||||||
|
v-for="item in menuItems"
|
||||||
|
:key="item.title"
|
||||||
|
:title="item.title"
|
||||||
|
:prepend-icon="item.icon"
|
||||||
|
@click="navigate(item.route)"
|
||||||
|
></v-list-item>
|
||||||
|
<v-list-item prepend-icon="mdi-cog" title="Administracion" @click="toggleAdminMenu()"></v-list-item>
|
||||||
|
<v-list-item>
|
||||||
|
<v-list v-if="showAdminMenu">
|
||||||
|
<v-list-item
|
||||||
|
v-for="item in menuAdminItems"
|
||||||
|
:key="item.title"
|
||||||
|
:title="item.title"
|
||||||
|
:prepend-icon="item.icon"
|
||||||
|
@click="navigateAdmin(item.route)"
|
||||||
|
></v-list-item>
|
||||||
|
</v-list>
|
||||||
|
</v-list-item>
|
||||||
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -26,13 +45,16 @@
|
|||||||
data: () => ({
|
data: () => ({
|
||||||
drawer: false,
|
drawer: false,
|
||||||
group: null,
|
group: null,
|
||||||
|
showAdminMenu: false,
|
||||||
menuItems: [
|
menuItems: [
|
||||||
{ title: 'Inicio', route: '/'},
|
{ title: 'Inicio', route: '/', icon: 'mdi-home'},
|
||||||
{ title: 'Comprar', route:'/comprar'},
|
{ title: 'Comprar', route:'/comprar', icon: 'mdi-cart'},
|
||||||
{ title: 'Cuadrar tarro', route: '/cuadrar_tarro'},
|
],
|
||||||
{ title: 'Cuadres de tarro', route: '/cuadres_de_tarro'},
|
menuAdminItems: [
|
||||||
{ title: 'CSV Tryton', route: '/ventas_para_tryton'},
|
{ title: 'Cuadrar tarro', route: '/cuadrar_tarro', icon: 'mdi-calculator'},
|
||||||
{ title: 'Compra adm', route: '/compra_admin'},
|
{ title: 'Cuadres de tarro', route: '/cuadres_de_tarro', icon: 'mdi-chart-bar'},
|
||||||
|
{ title: 'CSV Tryton', route: '/ventas_para_tryton', icon: 'mdi-file-table'},
|
||||||
|
{ title: 'Compra adm', route: '/compra_admin', icon: 'mdi-cart'},
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
watch: {
|
watch: {
|
||||||
@ -44,6 +66,13 @@
|
|||||||
navigate(route) {
|
navigate(route) {
|
||||||
this.$router.push(route);
|
this.$router.push(route);
|
||||||
},
|
},
|
||||||
|
navigateAdmin(route) {
|
||||||
|
this.toggleAdminMenu();
|
||||||
|
this.navigate(route);
|
||||||
|
},
|
||||||
|
toggleAdminMenu() {
|
||||||
|
this.showAdminMenu = !this.showAdminMenu;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user