vee-validate 4.12.2 → 4.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/vee-validate.d.ts +357 -506
- package/dist/vee-validate.esm.js +21 -18
- package/dist/vee-validate.js +21 -8
- package/dist/vee-validate.min.js +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ vee-validate offers two styles to integrate form validation into your Vue.js app
|
|
|
79
79
|
|
|
80
80
|
The fastest way to create a form and manage its validation, behavior, and values is with the composition API.
|
|
81
81
|
|
|
82
|
-
Create your form with `useForm` and then use `
|
|
82
|
+
Create your form with `useForm` and then use `defineField` to create your field model and props/attributes and `handleSubmit` to use the values and send them to an API.
|
|
83
83
|
|
|
84
84
|
```vue
|
|
85
85
|
<script setup>
|
|
@@ -91,14 +91,14 @@ function required(value) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// Create the form
|
|
94
|
-
const {
|
|
94
|
+
const { defineField, handleSubmit, errors } = useForm({
|
|
95
95
|
validationSchema: {
|
|
96
96
|
field: required,
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
// Define fields
|
|
101
|
-
const field =
|
|
101
|
+
const [field, fieldProps] = defineField('field');
|
|
102
102
|
|
|
103
103
|
// Submit handler
|
|
104
104
|
const onSubmit = handleSubmit(values => {
|
|
@@ -109,7 +109,7 @@ const onSubmit = handleSubmit(values => {
|
|
|
109
109
|
|
|
110
110
|
<template>
|
|
111
111
|
<form @submit="onSubmit">
|
|
112
|
-
<input v-
|
|
112
|
+
<input v-model="field" v-bind="fieldProps" />
|
|
113
113
|
<span>{{ errors.field }}</span>
|
|
114
114
|
|
|
115
115
|
<button>Submit</button>
|