Dynamically building a table using vuetifyJS data table Dynamically building a table using vuetifyJS data table vue.js vue.js

Dynamically building a table using vuetifyJS data table


I was looking at the same question, found a typical way to avoid hardcoding the data structure in the markup; you can use the content of the headers to script the item template using a v-for loop like this:

<div id="app">  <v-app id="inspire">    <v-data-table      :headers="headers"      :items="desserts"      hide-actions      class="elevation-1"    >      <template slot="items" slot-scope="myprops">        <td v-for="header in headers">        {{ myprops.item[header.value] }}        </td>      </template>    </v-data-table>  </v-app></div>