Solo se muestra en pedido

This commit is contained in:
Alejandro Tasistro 2025-05-21 18:39:56 -03:00
parent 2f7ee48930
commit 59b6c29508
2 changed files with 56 additions and 45 deletions

View file

@ -1,55 +1,59 @@
<template> <template>
<nav class="breadcrumb is-centered has-background-danger-light is-fixed-top" aria-label="breadcrumbs" v-show="visible"> <nav v-if="pedidoDefinido" class="breadcrumb is-centered has-background-danger-light is-fixed-top"
<ul class="mt-4"> aria-label="breadcrumbs" v-show="visible">
<li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i == migaActiva}"> <ul class="mt-4">
<a :href="miga.href" v-text="miga.nombre" <li v-for="(miga, i) in migas" :key="i" :class="{'is-active': i == migaActiva}">
:class="{'has-text-danger': i != migaActiva}"></a> <a :href="miga.href" v-text="miga.nombre"
</li> :class="{'has-text-danger': i != migaActiva}"></a>
</ul> </li>
</nav> </ul>
</nav>
</template> </template>
<script> <script>
export default { import { mapGetters } from "vuex";
data() {
return { export default {
initial: [{ nombre: 'Categorías', href: '/productos' }], data() {
migas: [{ nombre: 'Categorías', href: '/productos' }], return {
} initial: [{ nombre: 'Categorías', href: '/productos' }],
}, migas: [{ nombre: 'Categorías', href: '/productos' }],
computed: { }
visible: function() { },
return this.migas.length > 0 computed: {
}, ...mapGetters('pedido', ["pedidoDefinido"]),
migaActiva: function() { visible: function () {
return this.migas.length-1 return this.migas.length > 0
} },
}, migaActiva: function () {
mounted() { return this.migas.length - 1
Event.$on('migas-setear-como-inicio', (miga) => { }
this.migas = []; },
this.migas.push(miga); mounted() {
}); Event.$on('migas-setear-como-inicio', (miga) => {
Event.$on('migas-agregar', (miga) => { this.migas = [];
this.migas.push(miga); this.migas.push(miga);
}); });
Event.$on('migas-reset', () => { Event.$on('migas-agregar', (miga) => {
this.migas = this.initial; this.migas.push(miga);
}); });
Event.$on('migas-pop', () => { Event.$on('migas-reset', () => {
this.migas.pop(); this.migas = this.initial;
}); });
} Event.$on('migas-pop', () => {
} this.migas.pop();
});
}
}
</script> </script>
<style> <style>
nav.breadcrumb.is-fixed-top { nav.breadcrumb.is-fixed-top {
position: fixed; position: fixed;
left: 0; left: 0;
right: 0; right: 0;
top: 3.25rem; top: 3.25rem;
height: 2.75rem; height: 2.75rem;
z-index: 5; z-index: 5;
} }
</style> </style>

View file

@ -45,9 +45,16 @@ const actions = {
async modificarDevoluciones({ commit }, { monto, notas }) {} async modificarDevoluciones({ commit }, { monto, notas }) {}
}; };
const getters = {
pedidoDefinido() {
return state.lastFetch !== null;
},
}
export default { export default {
namespaced: true, namespaced: true,
state, state,
mutations, mutations,
actions, actions,
getters,
}; };