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: {
|
computed: {
|
||||||
...mapGetters('pedido', ["pedidoDefinido"]),
|
...mapGetters('pedido', ["pedidoDefinido"]),
|
||||||
...mapState('pedido',["nombre"]),
|
...mapState('pedido', ["nombre"]),
|
||||||
...mapState('pedido',["grupo_de_compra"]),
|
...mapState('pedido', ["grupo_de_compra"]),
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('productos', ["filtrarProductos"]),
|
...mapActions('productos', ["filtrarProductos"]),
|
||||||
...mapMutations('ui',["addMiga"]),
|
...mapMutations('ui', ["addMiga", "popUltimaBusqueda"]),
|
||||||
toggleBurger() {
|
toggleBurger() {
|
||||||
this.burgerActiva = !this.burgerActiva
|
this.burgerActiva = !this.burgerActiva
|
||||||
},
|
},
|
||||||
|
@ -75,6 +75,7 @@ export default {
|
||||||
if (this.burgerActiva)
|
if (this.burgerActiva)
|
||||||
this.toggleBurger();
|
this.toggleBurger();
|
||||||
this.filtrarProductos({ filtro: "nombre", valor: this.searchString });
|
this.filtrarProductos({ filtro: "nombre", valor: this.searchString });
|
||||||
|
this.popUltimaBusqueda();
|
||||||
this.addMiga({ nombre: this.searchString });
|
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) {
|
addMiga(state, miga) {
|
||||||
state.migas.push(miga);
|
state.migas.push(miga);
|
||||||
},
|
},
|
||||||
|
popUltimaBusqueda(state) {
|
||||||
|
if (!state.migas.at(-1).action)
|
||||||
|
state.migas.pop();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
|
|
Loading…
Add table
Reference in a new issue