new Vue({
el: '#app',
vuetify: new Vuetify(),
data () {
return {
headers: [
{
text: 'Dessert (100g serving)',
align: 'start',
sortable: false,
value: 'name',
},
{ text: 'Calories', value: 'calories' }
],
desserts: [
{
name: 'Frozen Yogurt',
calories: 159
},
{
name: 'Ice cream sandwich',
calories: 237
}
]
}
},
mounted() {
// This is just a mock example. You can replace this with an actual API response.
const res = [{
name: 'Burger',
calories: 200
}, {
name: 'Chocolate Cake',
calories: 250
}];
this.desserts = [...this.desserts, ...res];
}
})
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5d2b28381d6f7325">[email protected]</a>/dist/vue.js"></script>
<script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="14626171607d726d54263a223a2526">[email protected]</a>/dist/vuetify.min.js"></script>
<link rel="stylesheet" href="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0c7a796978656a754c3e223a223d3e">[email protected]</a>/dist/vuetify.min.css"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"/>
<div id="app">
<v-app id="inspire">
<v-data-table
:headers="headers"
:items="desserts"
:items-per-page="5"
class="elevation-1"
></v-data-table>
</v-app>
</div>