Currently, I am utilizing Vuetify and I am in the process of getting the server-side controlled data tables up and running. While browsing through the documentation, I stumbled upon this code snippet here.
However, I am facing some challenges in understanding how this code works. I am particularly perplexed by this specific piece of code.
An object without keys is being overridden by this.options
, but in reality, this.options
is actually empty as mentioned in the documentation.
data () {
return {
totalDesserts: 0,
desserts: [],
loading: true,
options: {}, //<--------------------- HERE
headers: [
{
text: 'Dessert (100g serving)',
align: 'start',
sortable: false,
value: 'name',
},
{ text: 'Calories', value: 'calories' },
{ text: 'Fat (g)', value: 'fat' },
{ text: 'Carbs (g)', value: 'carbs' },
{ text: 'Protein (g)', value: 'protein' },
{ text: 'Iron (%)', value: 'iron' },
],
}
},
const { sortBy, sortDesc, page, itemsPerPage } = this.options