diff --git a/src/composables/useRequired.js b/src/composables/useRequired.js index e650c91f5..d211b96b4 100644 --- a/src/composables/useRequired.js +++ b/src/composables/useRequired.js @@ -2,8 +2,14 @@ import { useValidator } from 'src/composables/useValidator'; export function useRequired($attrs) { const { validations } = useValidator(); - - const isRequired = Object.keys($attrs).includes('required'); + const hasRequired = Object.keys($attrs).includes('required'); + let isRequired = false; + if (hasRequired) { + const required = $attrs['required']; + if (typeof required === 'boolean') { + isRequired = required; + } + } const requiredFieldRule = (val) => validations().required(isRequired, val); return {