96. Validating Emails

npm create vue@latest


src/includes/validation.ts
import { Form as VeeForm, Field as VeeField, defineRule, ErrorMessage } from 'vee-validate'
import { required, min, max, alpha_spaces as alphaSpaces, email } from '@vee-validate/rules'
import type { App } from 'vue'

export default {
    // install(app: App, options?: { [key: string]: any }) {}
    install(app: App) {
        app.component('VeeForm', VeeForm)
        app.component('VeeField', VeeField)
        app.component('ErrorMessage', ErrorMessage)

        defineRule('required', required)
        defineRule('min', min)
        defineRule('max', max)
        defineRule('alpha_spaces', alphaSpaces)
        defineRule('email', email)
    }
}