arco design vue zod validation
npm i zod-arco-rules
<script setup lang="ts">
import * as z from 'zod'
import { zodArcoRules } from 'zod-arco-rules'
const { rules, handleSubmit } = zodArcoRules(z.object({
name: z.string().nonempty(),
post: z.string().min(2).max(30),
isRead: z.boolean(),
}))
const onSubmit = handleSubmit((values) => {
// Handle the validated values here
})
</script>
<template>
<a-form :model="form" :rules @submit="onSubmit">
<!-- ... -->
</a-form>
</template>
- Valibot support
- a-form validation status
- Auto form
MIT License © 2024-PRESENT Kevin Kwong