[Vuejs]-Select one component on click from a list of components in Vue.js

0👍

You’re toggling replypart off when you click on another ‘Reply’ button; you’d want to change your actionReply method to something like this:

actionReply: function (id) {
    // if this is the reply box for the selected comment, or if there are no reply boxes open
    if (id === this.selected_comment || this.replypart === false) {
        this.replypart = !this.replypart
    }
    this.selected_comment = id
}

Leave a comment