[Vuejs]-Mdb datatable does not rendering data in Vue.js

0👍

We’ve found the solution for Your issue.
The new code is available here: https://mdbootstrap.com/docs/vue/tables/datatables/#external-api

Also to make sure the data is reactive it’s necessary to add the following code to the Datatable component in our package:

watch: {
    data(newVal) {
      this.columns = newVal.columns;
    },
    (...)
}

It will be fixed in the next MDB Vue release.

0👍

I installed mdbvue 5.5.0 which includes the change that mikolaj described. This caused the table columns to update when changed but in order to get the rows to update too I had to add to the watch method in Datatable.vue as follows:

watch: {
data(newVal) {
  this.columns = newVal.columns;
  this.rows = newVal.rows;
},

Leave a comment