diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 05c74f00a..e8083dec2 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -57,7 +57,7 @@ const $props = defineProps({ }); const { t } = useI18n(); -const requiredFieldRule = (val) => !!val || t('globals.fieldRequired'); +const requiredFieldRule = (val) => val ?? t('globals.fieldRequired'); const { optionLabel, optionValue, options, modelValue } = toRefs($props); const myOptions = ref([]); @@ -167,6 +167,7 @@ watch(modelValue, (newValue) => { hide-selected fill-input ref="vnSelectRef" + lazy-rules :class="{ required: $attrs.required }" :rules="$attrs.required ? [requiredFieldRule] : null" virtual-scroll-slice-size="options.length" diff --git a/src/pages/Item/Card/ItemTags.vue b/src/pages/Item/Card/ItemTags.vue index 01df1009b..b3cdfffb1 100644 --- a/src/pages/Item/Card/ItemTags.vue +++ b/src/pages/Item/Card/ItemTags.vue @@ -105,7 +105,7 @@ const insertTag = (rows) => { auto-load @on-fetch="onItemTagsFetched" > -