From 7bb531056c60a8e4fbd0b594b4ce68c69df2546d Mon Sep 17 00:00:00 2001 From: josedario87 Date: Sun, 19 Oct 2025 01:15:01 -0600 Subject: [PATCH] =?UTF-8?q?Fix:=20Asegurar=20inicializaci=C3=B3n=20correct?= =?UTF-8?q?a=20del=20valor=20por=20defecto=20en=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Agregar watcher que resetea el estado cuando el modal se abre - Asegurar que puntajeDeseado siempre inicie en 40 - Eliminar setTimeout del método cerrar() (ya no necesario) - Soluciona problema donde el botón Continuar no funcionaba con valor 40 --- .../app/components/cata/ModalAsignacionRapida.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/nuxt4/app/components/cata/ModalAsignacionRapida.vue b/nuxt4/app/components/cata/ModalAsignacionRapida.vue index 0fa5ddc..5ae98be 100644 --- a/nuxt4/app/components/cata/ModalAsignacionRapida.vue +++ b/nuxt4/app/components/cata/ModalAsignacionRapida.vue @@ -135,6 +135,15 @@ const paso = ref(1) const puntajeDeseado = ref(40) const categoriasSeleccionadas = ref([]) +// Resetear estado cuando el modal se abre +watch(isOpen, (newValue) => { + if (newValue) { + paso.value = 1 + puntajeDeseado.value = 40 + categoriasSeleccionadas.value = [] + } +}) + // Cálculos const puntajeValido = computed(() => { return puntajeDeseado.value >= 8 && puntajeDeseado.value <= 80 @@ -217,12 +226,6 @@ const aplicarAsignacion = () => { const cerrar = () => { isOpen.value = false - // Resetear estado - setTimeout(() => { - paso.value = 1 - puntajeDeseado.value = 40 - categoriasSeleccionadas.value = [] - }, 300) }