Update InputText VeeValidate demo

pull/3758/head
Tuğçe Küçükoğlu 2023-03-16 09:36:14 +03:00
parent 4f0b15f39a
commit 8d573c08c7
1 changed files with 9 additions and 6 deletions

View File

@ -24,8 +24,9 @@ export default {
const { errors, useFieldModel, handleSubmit } = useForm(); const { errors, useFieldModel, handleSubmit } = useForm();
const value = useFieldModel('value'); const value = useFieldModel('value');
const onInput = (e) => { const onInput = (newValue) => {
handleChange('e.target.value'); handleChange(newValue);
onSubmit();
}; };
const onSubmit = handleSubmit((values, actions) => { const onSubmit = handleSubmit((values, actions) => {
@ -77,8 +78,9 @@ export default {
const { errors, useFieldModel, handleSubmit } = useForm(); const { errors, useFieldModel, handleSubmit } = useForm();
const value = useFieldModel('value'); const value = useFieldModel('value');
const onInput = (e) => { const onInput = (newValue) => {
handleChange('e.target.value'); handleChange(newValue);
onSubmit();
}; };
const onSubmit = handleSubmit((values, actions) => { const onSubmit = handleSubmit((values, actions) => {
@ -113,8 +115,9 @@ const { handleChange } = useField();
const { errors, useFieldModel, handleSubmit } = useForm(); const { errors, useFieldModel, handleSubmit } = useForm();
const value = useFieldModel('value'); const value = useFieldModel('value');
const onInput = (e) => { const onInput = (newValue) => {
handleChange('e.target.value'); handleChange(newValue);
onSubmit();
}; };
const onSubmit = handleSubmit((values, actions) => { const onSubmit = handleSubmit((values, actions) => {