错误

父组件代码:
events: {
'list-msg': msg => {
this.msg1 = msg
}
},
子组件代码:
methods: {
getRoot () {
this.$dispatch('list-msg', this.msg)
this.msg = ''
},
}
求教
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
是vue1还是vue2?
vue2中$dispatch 和 $broadcast 已经被弃用。
https://cn.vuejs.org/v2/guide...和-broadcast-替换