feat(VnInput): empty to null
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
ec88bcbc44
commit
abd7b76636
|
@ -27,6 +27,10 @@ const $props = defineProps({
|
|||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
emptyToNull: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
const { validations } = useValidator();
|
||||
|
||||
|
@ -39,6 +43,7 @@ const value = computed({
|
|||
return $props.modelValue;
|
||||
},
|
||||
set(value) {
|
||||
if ($props.emptyToNull && value === '') value = null;
|
||||
emit('update:modelValue', value);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue