-2
rated 0 times
[
4]
[
6]
/ answers: 1 / hits: 43182
/ 7 Years ago, wed, april 5, 2017, 12:00:00
I have a very simple app:
<div id=show_vue>
<page-change page=bio @click=changeThePage></page-change>
<page-change page=health @click=changeThePage></page-change>
<page-change page=finance @click=changeThePage></page-change>
<page-change page=images @click=changeThePage></page-change>
</div>
Vue.component(page-change, {
template: <button class='btn btn-success'>Button</button>,
props: [page]
})
var clients = new Vue({
el: '#show_vue',
data: {
currentRoute: window.location.href
},
methods: {
changeThePage: function() {
console.log(this is working)
}
}
})
...but when I click the <page-change></page-change>
button, nothing is logged to the console. I know I'm missing something simple but I'm not getting any errors.
How do I make my click fire changeThePage
More From » vue.js