NikulinIlya / vue-easymde

📝 Vue-EasyMDE - use easy-markdown-editor with vue.js.
MIT License
21 stars 10 forks source link

Reset mde field after submitting #16

Open mark123jesper opened 3 years ago

mark123jesper commented 3 years ago

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

trikarai commented 2 years ago

https://github.com/NikulinIlya/vue-easymde/issues/3