Please ignore again. After posting this, I started reading the discussion here: VueJs - where to store my data
And realized computed methods work the other way around, not how I wanted to use them, I need a watch method... changing the code now...
[30 minutes later]
OK, sorry, lost the plot again.
so I bing the combovox to a value using v-model
:
<v-combobox label="Presets"
:items="['Today', 'Yesterday', 'Last 7 days', 'This week', 'Last Week', 'This Month', 'Last Month']"
v-model="preset"></v-combobox>
And I include the this preset
value in the data model:
data() {
return {
dialogData:null,
fromdatevalue: Date.now(),
todatevalue: Date.now(),
preset: ''
}
And I create a watch
function to handle when this is getting changed:
preset: function() {
console.log(preset);
var today = new Date();
this.fromdatevalue = today.toISOString().split('T')[0];
this.todatevalue = new Date(today.getTime() + 24*60*60*1000).toISOString().split('T')[0];
}
But how do I get what option was selected in the combobox?