4👍
✅
How about using a helper method ..
methods: {
...
call(methodName) {
this[methodName]()
}
}
Then you can do this in your template ..
<v-btn icon flat class="header-button" v-for="(button, i) in cardHeaderButtons"
:key="i"
v-if="$vuetify.breakpoint.lgAndUp"
color="white"
@click.capture.stop="call(button.fn)"
>
1👍
maybe try @click.capture.stop="eval(button.fn).call()"
1👍
pass button
as parameter to a method like :
@click.capture.stop="callBtn(button)"
in your methods :
methods:{
callBtn(button){
button.fn();
}
...
}
Source:stackexchange.com