BarraDeNavegacion #49

Merged
Rodia merged 5 commits from BarraDeNavegacion into main 2024-10-05 12:35:24 -05:00
3 changed files with 40 additions and 79 deletions

View File

@ -1,7 +1,7 @@
<template> <template>
<v-app> <v-app>
<v-main>
<NavBar /> <NavBar />
<v-main>
<router-view /> <router-view />
</v-main> </v-main>
</v-app> </v-app>
@ -17,26 +17,3 @@
}, },
} }
</script> </script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
nav {
padding: 30px;
}
nav a {
font-weight: bold;
color: #2c3e50;
}
nav a.router-link-exact-active {
color: #42b983;
}
</style>

View File

@ -1,64 +1,46 @@
<template> <template>
<v-main> <v-app-bar color="primary" prominent>
<v-card>
<v-layout>
<v-app-bar color="primary" prominent app>
<v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon> <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
<v-toolbar-title>My files</v-toolbar-title> <v-toolbar-title>Menu</v-toolbar-title>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<template v-if="$vuetify.display.mdAndUp"> <template v-if="$vuetify.display.mdAndUp">
<v-btn icon="mdi-magnify" variant="text"></v-btn> <v-btn icon="mdi-magnify" variant="text"></v-btn>
<v-btn icon="mdi-filter" variant="text"></v-btn> <v-btn icon="mdi-filter" variant="text"></v-btn>
</template> </template>
<v-btn icon="mdi-dots-vertical" variant="text"></v-btn> <v-btn icon="mdi-dots-vertical" variant="text"></v-btn>
</v-app-bar> </v-app-bar>
<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 :items="items"></v-list> <v-list>
<v-list-item v-for="item in menuItems" :key="item.title" @click="navigate(item.route)">
<v-list-item-title>{{ item.title }}</v-list-item-title>
</v-list-item>
</v-list>
</v-navigation-drawer> </v-navigation-drawer>
<v-main style="height: 500px;">
<v-card-text>
The navigation drawer will appear from the bottom on smaller size screens.
</v-card-text>
</v-main>
</v-layout>
</v-card>
</v-main>
</template> </template>
<script> <script>
export default { export default {
name: 'NavBar',
data: () => ({ data: () => ({
drawer: false, drawer: false,
group: null, group: null,
items: [ menuItems: [
{ { title: 'Inicio', route: '/'},
title: 'Foo', { title: 'Comprar', route:'/comprar'},
value: 'foo', { title: 'Resumen de Compra', route:'/resumen_compra'},
},
{
title: 'Bar',
value: 'bar',
},
{
title: 'Fizz',
value: 'fizz',
},
{
title: 'Buzz',
value: 'buzz',
},
], ],
}), }),
watch: { watch: {
group () { group () {
this.drawer = false this.drawer = false
}, },
}, },
methods: {
navigate(route) {
this.$router.push(route);
},
}
} }
</script> </script>

View File

@ -87,11 +87,8 @@
</v-row> </v-row>
</v-container> </v-container>
<v-btn @click="addLine" color="blue">Agregar</v-btn> <v-btn @click="addLine" color="blue">Agregar</v-btn>
</v-container> </v-container>
<v-divider></v-divider> <v-divider></v-divider>
<v-text-field <v-text-field
:value="calculateTotal" :value="calculateTotal"
label="Total" label="Total"
@ -133,6 +130,11 @@
this.fetchClients(); this.fetchClients();
this.fetchProducts(); this.fetchProducts();
}, },
watch: {
group () {
this.drawer = false
},
},
computed: { computed: {
calculateTotal() { calculateTotal() {
return this.purchase.saleline_set.reduce((total, saleline) => { return this.purchase.saleline_set.reduce((total, saleline) => {