From 73eb3dcbee8eb4e8984849c59e8c8a1d981cb090 Mon Sep 17 00:00:00 2001 From: wbuezas Date: Mon, 19 Aug 2024 08:44:40 -0300 Subject: [PATCH] Updating VnInput --- src/components/common/VnInput.vue | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index f8af8001..387f5d7e 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -56,10 +56,14 @@ defineExpose({ const inputRules = [ val => { - const { min } = vnInputRef.value.$attrs; + console.log('asd'); + const { min, max } = vnInputRef.value.$attrs; if (min >= 0) { if (Math.floor(val) < min) return t('inputMin', { value: min }); } + if (max > 0) { + if (Math.floor(val) > max) return t('inputMax', { value: max }); + } } ]; @@ -111,12 +115,17 @@ const inputRules = [ en-US: inputMin: Must be more than {value} + inputMax: Must be less than {value} es-ES: - inputMin: Must be more than {value} + inputMin: Debe ser mayor a {value} + inputMax: Debe ser menor a {value} ca-ES: inputMin: Ha de ser més gran que {value} + inputMax: Ha de ser menys que {value} fr-FR: inputMin: Doit être supérieur à {value} + inputMax: Doit être supérieur à {value} pt-PT: inputMin: Deve ser maior que {value} + inputMax: Deve ser maior que {value}