0👍
useForm
is just an object wrapper that has pre-defined method you can use, you can take a look at the source code here.
e.i you can use transform
, post
, reset
with a callback onFinish
import { useForm } from '@inertiajs/vue3'
const form = useForm({
email: null,
password: null,
remember: null
})
const submit = () => {
form.loading = true
form.transform(data => ({
...data,
remember: form.remember ? 'on' : '',
})).post('/url', {
onFinish: () => {
form.loading = false
form.reset('password')
},
});
}
the HTTP request from useForm
are using inertia router
which also uses axios,
So;
useForm – is an object form helper that also uses axios
axios – is a full HTTP library
- [Vuejs]-How to run a function in a singleton file only when electron main process is ready
- [Vuejs]-Why pagination with numbers is not working in Vue?
Source:stackexchange.com