vue子组件传父组件
1、子组件created中this.$emit两个参数(要传给谁,要传的信息)
2、@定义一个方法,用于接收son传过来的信息
3、得到son传过来的信息,固定参数data
4、父元素data中定义数据用来接收使用来自son的信息
5、将得到的data值(这里的data是自定义方法中的data)传给data中定义好的数据中使用
6、使用son传来的信息
{{fathermsg}} {{usesonmsg}} {{sonmsg}}
原文:https://www.cnblogs.com/myqinyh/p/15306092.html