vuestic-ui icon indicating copy to clipboard operation
vuestic-ui copied to clipboard

VaForm validation state

Open m0ksem opened this issue 2 years ago • 1 comments

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.

m0ksem avatar Aug 26 '22 21:08 m0ksem

I think we can add both slot and expose from ref.

asvae avatar Sep 01 '22 10:09 asvae