Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client site validation with inertia (laravel) #4700

Closed
Lioxen opened this issue Mar 14, 2024 · 1 comment
Closed

client site validation with inertia (laravel) #4700

Lioxen opened this issue Mar 14, 2024 · 1 comment

Comments

@Lioxen
Copy link

Lioxen commented Mar 14, 2024

Is your feature request related to a problem? Please describe.
Inertia has also a javascript function called useForm()

I'm like to use Vue3,Inertia and PrimeVue for my project and looking for a client site validation library. The PrimeVue example uses the vee-validate useForm() function but Inertia has also a function with this name. So I guess, this is a problem?

Is there a way to use vee-validate with Inertia?

@logaretm
Copy link
Owner

I never used inertia myself but you can rename your imports and use either as you see fit.

import { useForm as useVeeForm } from 'vee-validate';
import { useForm as useInertiaForm } from '@inertiajs/vue3'

const form = useInertiaForm({
  email: null,
  password: null,
  remember: false,
}); 

const { handleSubmit } = useVeeForm();

const onSubmit = handleSubmit(() => {
  form.post('/login');
});

@logaretm logaretm closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants