List of options as JS object:
options: [{
text: this.$t('analytics.pastDays', { days: 7 }),
value: 7
}, {
text: this.$t('analytics.pastDays', { days: 28 }),
value: 28
}, {
text: this.$t('analytics.pastDays', { days: 360 }),
value: 360
}, {
text: this.$t('analytics.customDate'),
value: 7,
method: () => { console.log('Worked') }
}],
Select element:
<select
class="i-select"
v-model="value"
@change="onChange($event)">
<option
v-for="option in options"
:value="option.value"
@click.stop.prevent="option.method($event)">
{{ option.text }}
</option>
</select>
Right know the console logs never logs.
How to make it so that the analytics.CustomDate options triggers its method?