子組件:this.$emit('on-msg', '這是給父組件的信息')父組件:<template> <div> <child @on-msg="listenChildMsg"></child> </div></template><script>...export default { ... methods: { listenChildMsg (msg, msg2) { console.log(msg) // 這是給父組件的信息 console.log(msg2) // 這是需要手動傳入內(nèi)容 } }}</script>如何在父組件中使用子組件時 <child @on-msg="listenChildMsg"></child> 不影響第一個參數(shù),傳入第二個參數(shù)的內(nèi)容?
vue 父組件監(jiān)聽子組件參數(shù)問題
qq_遁去的一_1
2018-12-28 22:14:50