Skip to content

Reset mde field after submitting #16

@mark123jesper

Description

@mark123jesper

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions