DEV Community

Discussion on: How to make a form handling with vuex

Collapse
 
vamsigandra profile image
Vamsi

Thanks! This is exactly what I am looking for.
Where do you call the mapFields function. Could you please show an example?

Collapse
 
matheusgomes062 profile image
Matheus Gomes 👨‍💻

My fault, I will edit the post to answer you, sorry for this and thanks for asking.

Collapse
 
lilarmstrong profile image
Armstrong

I think if you do something like

...

Then, in your methods you define the 'handleSubmi function as follows:

methods:{
handleSubmit(e){
e.preventDefault();
mapFields(e)
//...
}

I think something like the above would do... what do you think?

Collapse
 
matheusgomes062 profile image
Matheus Gomes 👨‍💻

I would use it in the computed property, so i could change the state as i input .