父组件调用子组件的时候实例
<changeYourInformation ref="changeInformation" ></changeYourInformation>
ref就可以绑定子组件中的方法,在JS调用的时候,写上
this.$refs.changeInformation.changeInformation()
最后的那个就是子组件的方法
同理 子组件调用父组件方法为
this.$parent.父组件方法名
也可以使用props将父组件的方法传递过来 然后在子组件使用
也可以在子组件emit到父组件一个指令,然后这个指令在父组件去操作他的方法