No se stackean las busquedas
This commit is contained in:
parent
134ed0cd22
commit
802d4d0c0b
2 changed files with 8 additions and 3 deletions
|
@ -62,12 +62,12 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapGetters('pedido', ["pedidoDefinido"]),
|
||||
...mapState('pedido',["nombre"]),
|
||||
...mapState('pedido',["grupo_de_compra"]),
|
||||
...mapState('pedido', ["nombre"]),
|
||||
...mapState('pedido', ["grupo_de_compra"]),
|
||||
},
|
||||
methods: {
|
||||
...mapActions('productos', ["filtrarProductos"]),
|
||||
...mapMutations('ui',["addMiga"]),
|
||||
...mapMutations('ui', ["addMiga", "popUltimaBusqueda"]),
|
||||
toggleBurger() {
|
||||
this.burgerActiva = !this.burgerActiva
|
||||
},
|
||||
|
@ -75,6 +75,7 @@ export default {
|
|||
if (this.burgerActiva)
|
||||
this.toggleBurger();
|
||||
this.filtrarProductos({ filtro: "nombre", valor: this.searchString });
|
||||
this.popUltimaBusqueda();
|
||||
this.addMiga({ nombre: this.searchString });
|
||||
}
|
||||
},
|
||||
|
|
4
resources/js/store/modules/ui.js
vendored
4
resources/js/store/modules/ui.js
vendored
|
@ -16,6 +16,10 @@ const mutations = {
|
|||
addMiga(state, miga) {
|
||||
state.migas.push(miga);
|
||||
},
|
||||
popUltimaBusqueda(state) {
|
||||
if (!state.migas.at(-1).action)
|
||||
state.migas.pop();
|
||||
}
|
||||
};
|
||||
|
||||
const actions = {
|
||||
|
|
Loading…
Add table
Reference in a new issue