Calling method: 1. In the parent component, directly call the child component's method through ref; 2. In the parent component, call through the component's "$emit" and "$on" methods.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
How to directly call the child component in the parent component in the Vue project:
Option 1: Directly call the child through ref Component method;
//父组件中//子组件中 我是子组件
Option 2: Through the $emit and $on methods of the component;
//父组件中//子组件中 我是子组件
Related recommendations: "vue.js Tutorial》
The above is the detailed content of How to call the method of child component in vue parent component. For more information, please follow other related articles on the PHP Chinese website!