Currently, I am working on implementing a date range picker using Vue.js and have established an array of methods containing preset ranges.
presetRanges:{
last7Days(){
return{
label: 'Last 7 days',
dateRange:{
start: this.$moment(today).substract(7, 'd')
}
}
},
last30Days(){
return{
label: 'Last 30 days',
dateRange:{
start: this.$moment(today).substract(30, 'd')
}
}
},
last60Days(){
return{
label: 'Last 60 days',
dateRange:{
start: this.$moment(today).substract(60, 'd')
}
}
},
}
I am facing an issue with displaying each method's returned label in a for loop. The following code snippet was previously functional but seems to be causing problems now:
<li v-for="(item, idx) in presetRanges" :key="idx">"
{{ item.label }}
</li>
I attempted using {{ item().label }}
as well, however, it also did not yield the desired output.