1、1.在父组件中写一个ref="",代码
2、2.js方法代码
3、3.子组件的代码:
1、1.子组件的模板代码
2、2.js代码用$ref调用即可
3、3.父组件: 在子组件中加上ref即可通过this.$refs.ref.method调用方法代码