Skip to content Skip to sidebar Skip to footer

Vue.js: Html Element Show-if Not Toggling Changes

I'm initially rendering some objects from an API call to my database, they are serialized and look like this initially:

Messages on Database

Instead, if you enrich responseData properties before binding it to the Vue data properties, all the array stays reactive. I mean like this:

fetchMessages() {
 this.$backend.$fetchMessages().then(responseData => {
        let editableMessages = responseData;
        editableMessages.forEach(function (value) {
           value['editing'] = false;
        });
        this.messages = editableMessages;
      });
}

Here there is a small example based on your domain.

Post a Comment for "Vue.js: Html Element Show-if Not Toggling Changes"