@vue-formify/joi
v1.1.4
Published
Joi schema integration for vue-formify
Downloads
89
Maintainers
Readme
📦 Install
npm i @vue-formify/joi
💻 Usage
<script lang="ts" setup>
import { schemaFromJoi } from '@vue-formify/joi';
import { object, string } from 'joi'
const schema = schemaFromJoi(
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>