From a131cb559dbbc8f012f650bd6cbdd0130042a6d4 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 21 Aug 2024 13:34:40 +0200 Subject: [PATCH 1/6] feat: add max rule --- src/components/common/VnInput.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/common/VnInput.vue b/src/components/common/VnInput.vue index 75d4b8a28..e79a235d5 100644 --- a/src/components/common/VnInput.vue +++ b/src/components/common/VnInput.vue @@ -67,9 +67,13 @@ const mixinRules = [ requiredFieldRule, ...($attrs.rules ?? []), (val) => { - const { min } = vnInputRef.value.$attrs; + const { min, max } = vnInputRef.value.$attrs; if (!min) return null; if (min >= 0) if (Math.floor(val) < min) return t('inputMin', { value: min }); + if (!max) return null; + if (max > 0) { + if (Math.floor(val) > max) return t('inputMax', { value: max }); + } }, ]; @@ -116,6 +120,8 @@ const mixinRules = [ en: inputMin: Must be more than {value} + inputMax: Must be less than {value} es: inputMin: Debe ser mayor a {value} + inputMax: Debe ser menor a {value} From 401400bdcfc8b03eab00a4e40dc78ad1ea1fe9e7 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 13 Sep 2024 22:52:26 +0200 Subject: [PATCH 2/6] fix: remove FetchData --- src/components/common/VnSelect.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 837a3d9f6..e767fb201 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -1,6 +1,7 @@