1、 子组件不传递参数,父组件也不接受参数
// 子组件
this.$emit('test')
// 父组件
@test='test'
test() {
}
2、 子组件传递一个参数,父组件接收时不带形参
// 子组件
this.$emit('test','哈哈')
// 父组件
@test='test'
test(param)
1、 子组件不传递参数,父组件也不接受参数
// 子组件
this.$emit('test')
// 父组件
@test='test'
test() {
}
2、 子组件传递一个参数,父组件接收时不带形参
// 子组件
this.$emit('test','哈哈')
// 父组件
@test='test'
test(param)