Reset mde field after submitting
Opened this issue · 1 comments
mark123jesper commented
After submitting the value on field I can't seem to empty it even after submitting
export default {
props: ["questionSlug"],
data() {
return {
form: {
body: ""
}
};
},
methods: {
submit() {
axios
.post(`/api/question/${this.questionSlug}/reply`, {
body: this.form.body
})
.then((response) => {
this.form.body = ""
EventBus.$emit("newReply", response.data.replies);
})
.catch(error => console.error(error)
);
}
}
};
here is my code for that part