Fix: Asegurar inicialización correcta del valor por defecto en modal
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m8s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m8s
- 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
This commit is contained in:
@@ -135,6 +135,15 @@ const paso = ref(1)
|
|||||||
const puntajeDeseado = ref<number>(40)
|
const puntajeDeseado = ref<number>(40)
|
||||||
const categoriasSeleccionadas = ref<string[]>([])
|
const categoriasSeleccionadas = ref<string[]>([])
|
||||||
|
|
||||||
|
// Resetear estado cuando el modal se abre
|
||||||
|
watch(isOpen, (newValue) => {
|
||||||
|
if (newValue) {
|
||||||
|
paso.value = 1
|
||||||
|
puntajeDeseado.value = 40
|
||||||
|
categoriasSeleccionadas.value = []
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// Cálculos
|
// Cálculos
|
||||||
const puntajeValido = computed(() => {
|
const puntajeValido = computed(() => {
|
||||||
return puntajeDeseado.value >= 8 && puntajeDeseado.value <= 80
|
return puntajeDeseado.value >= 8 && puntajeDeseado.value <= 80
|
||||||
@@ -217,12 +226,6 @@ const aplicarAsignacion = () => {
|
|||||||
|
|
||||||
const cerrar = () => {
|
const cerrar = () => {
|
||||||
isOpen.value = false
|
isOpen.value = false
|
||||||
// Resetear estado
|
|
||||||
setTimeout(() => {
|
|
||||||
paso.value = 1
|
|
||||||
puntajeDeseado.value = 40
|
|
||||||
categoriasSeleccionadas.value = []
|
|
||||||
}, 300)
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user