I have my vue instance:
var testOptions = new Vue({
el: '#testOptions',
methods: {
getURL: function () {
return (window.location.href);
},
testOne: function () {
console.log('!!');
},
testTwo: function () {
console.log('!!!!');
}
},
data: {
shares: [
{ text: 'testOne', icon: 'ico_test1.svg',func: testOne() },
{ text: 'testTwo', icon: 'ico_test2.svg', func: testTwo() },
]
}
});
Is it possible to call my method testOne/testTwo which I pass to shares array like this:
<li v-on:click="share.func" class="test-options__option">
{{share.text}}
</li>