From 2a57fdc1e91b0f75ddc26acdfd8f6aaa3766ae9f Mon Sep 17 00:00:00 2001 From: ale Date: Thu, 29 Aug 2024 22:54:05 -0300 Subject: [PATCH] Solo actualiza el producto que cambia --- resources/js/components/ProductoCard.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/js/components/ProductoCard.vue b/resources/js/components/ProductoCard.vue index 12974af..bccc2c6 100644 --- a/resources/js/components/ProductoCard.vue +++ b/resources/js/components/ProductoCard.vue @@ -11,7 +11,10 @@ export default { } }, mounted() { - Event.$on('sync-subpedido', (cantidad,_) => this.sincronizar(cantidad)); + Event.$on('sync-subpedido', (cantidad,productoId) => { + if (this.producto.id === productoId) + this.sincronizar(cantidad); + }); }, methods: { decrementar() {