I have a very simple app:
When you do :
That means that your are waiting page-change
component emit the click
event.
Vue.component("page-change", {
template: "",
props: ["page"],
methods: {
clicked: function(event) {
this.$emit('click', this.page, event);
}
}
})
For information event
is the default value passed by Vue for native event like click
: DOM event
Vue.component("page-change", {
template: "",
props: ["page"]
})
var clients = new Vue({
el: '#show_vue',
data: {
currentRoute: window.location.href,
pages: [
'bio', 'health',
'finance', 'images'
]
},
methods: {
changeThePage: function(page, index) {
console.log("this is working. Page:", page, '. Index:', index)
}
}
});