Hello there #Vue.js2 I'm encountering a problem on creating a function called in a form submit event This function needs to take 2 parameters : EVENT and ID My problem now is when I call this function i can't specify the event param without having error so my formdata and my id will be undefined in my logs. Is there any better way to handle my form ?
updatePost(event, id) {
const postId = id;
const updatedPost = new FormData(event.target); // Any way to not use event param to save this ?
console.log(updatedPost, postId);
},
// Call in my Template but :
<form @submit.prevent="updatePost(post.id)">
ps : form composed by 2 inputs type text and 1 input type file.Vue.js screenShot