I have this code:
new Vue({
el: '#app',
components: {
'app-component': AppComponent
},
data: {
message: 'Hello Vue.js!'
},
methods: {
doSomething: function(){
console.log('arrived!')
}
}
})
How can I call "doSomething" method from AppComponent html template? like this:
<app-component>
<a href="#" v-on:click="doSomething()">text</a>
</app-component>
I get this error:
Uncaught TypeError: scope.doSomething is not a function
v-on:click="doSomething"