@vue-formify/yup
v1.1.4
Published
Yup schema integration for vue-formify
Downloads
33
Maintainers
Readme
📦 Install
npm i @vue-formify/yup
💻 Usage
<script lang="ts" setup>
import { schemaFromYup } from '@vue-formify/yup';
import { object, string } from 'yup'
const schema = schemaFromYup(
object({
first_name: string().required(),
last_name: string().required(),
})
)
const sendForm = (data) => {
console.log('data', data);
};
</script>
<template>
<FormifyForm @submit="sendForm" :validation-schema="schema">
<FormifyInput name="first_name" />
<FormifyInput name="last_name" />
<button>Send</button>
</FormifyForm>
</template>