ゾンビイベントを削除するには?Vue JSゾンビイベントを削除するには?
前と後の$ onイベントを切り替えると何度も動きます。
App.vue
<template>
<input type="button" @click.prevent="click()" value="click">
<template>
<script>
export default {
methods: {
click: function(){
this.$emit('go')
}
}
}
<script>
Children.vue
<script>
export default {
methods: {
go: function() {
console.log('event received')
}
},
created: function(){
this.$parent.$on('go', this.go);
}
}
<script>
はい、これは私が必要なものです。ありがとうございました。 –