使用vue2.x自定義事件可否傳遞多個參數(shù)?子組件
<button @click="setEvent">自定義事件傳參</button>
methods:{
setEvent () { this.$emit('getEvent','參數(shù)一','參數(shù)二')
}
}
父組件
<child-event @getEvent="handlerEvent"></child-event>
methods:{
handlerEvent ($event) {
console.log($event)
}
}父組件怎么才能同時接收到子組件的兩個(多個參數(shù))?
添加回答
舉報
0/150
提交
取消