-
I have written a component which accepts a I've tried setting the rules to undefined like this, but it's not working for me. It doesn't seem that the rules argument is reactive? const disabled = toRef(props, 'disabled');
const { errors, errorMessage, handleBlur, handleChange, meta, setErrors, validate, value } = useField(
() => props.name,
disabled.value ? undefined : props.rules,
{
label: props.validationProps.name ?? label,
validateOnValueUpdate: false,
type: props.checkbox ? 'checkbox' : undefined,
checkedValue: props.checkbox ? props.value : undefined,
initialValue: props.value,
},
); Open to any other ideas! Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
same problem |
Beta Was this translation helpful? Give feedback.
-
Use useField(name, computed(() => disabled.value ? '' : 'required')); |
Beta Was this translation helpful? Give feedback.
Use
computed
.