How do you get rid of a zombie event?
When navigating back and forth, the events run multiple times.
MainApp.vue
<template>
<input type="button" @click.prevent="handleClick()" value="Click Me">
</template>
<script>
export default {
methods: {
handleClick: function (){
this.$emit('go')
}
}
}
</script>
ChildComponent.vue
<script>
export default {
methods: {
go: function () {
console.log('Event received')
}
},
created: function (){
this.$parent.$on('go', this.go);
}
}
</script>