Migas simplificadas por renderizarse solo despues de que el pedido se defina
This commit is contained in:
parent
1eb77be1d0
commit
c8d1969352
1 changed files with 11 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<nav v-if="pedidoDefinido" class="breadcrumb is-centered has-background-danger-light is-fixed-top"
|
||||
<nav class="breadcrumb is-centered has-background-danger-light is-fixed-top"
|
||||
aria-label="breadcrumbs" v-show="visible">
|
||||
<ul class="mt-4">
|
||||
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i === migaActiva}">
|
||||
|
@ -11,33 +11,26 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions, mapGetters, mapMutations, mapState } from "vuex";
|
||||
import { mapActions, mapMutations, mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
...mapActions('productos',["getProductos"]),
|
||||
...mapActions('ui',["clickMiga"]),
|
||||
...mapMutations('ui',["addMiga"]),
|
||||
...mapActions('productos', ["getProductos"]),
|
||||
...mapActions('ui', ["clickMiga"]),
|
||||
...mapMutations('ui', ["addMiga"]),
|
||||
},
|
||||
computed: {
|
||||
...mapState('ui',["migas"]),
|
||||
...mapGetters('pedido',["pedidoDefinido"]),
|
||||
...mapState('ui', ["migas"]),
|
||||
visible() {
|
||||
return this.migas.length > 0
|
||||
return this.migas.length > 0;
|
||||
},
|
||||
migaActiva() {
|
||||
return this.migas.length - 1
|
||||
return this.migas.length - 1;
|
||||
},
|
||||
pedido() {
|
||||
return this.pedidoDefinido
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
pedido(newValue) {
|
||||
if (newValue)
|
||||
this.addMiga({ nombre: 'Categorias', action: 'productos/getProductos' });
|
||||
}
|
||||
}
|
||||
mounted() {
|
||||
this.addMiga({ nombre: 'Categorias', action: 'productos/getProductos' });
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue