vuestic-ui
vuestic-ui copied to clipboard
VaForm validation state
Likely related to https://github.com/epicmaxco/vuestic-ui/issues/2117, but musthave feature.
VaForm must expose validation state of it's items.
For example:
<va-form> ...
<va-button :disabled="isFormValid"> Send! </va-button>
Now you need to make watcher over all data used in form and validate it with nextTick:
const isFormValid = ref(false)
const form = ref<typeof VaForm>()
const validate = () => {
return isFormValid.value = form.value?.validate()
}
watch(formData, () => {
nextTick(() => validate())
})
This is not intuitive.
I think we can add both slot and expose from ref.