The child component calls the method of the parent component
Register an event for the referenced child component in the parent component (the name of this event is custom)
Subcomponents can trigger this event $emit('event name')
Pass data from child component to parent component
The second parameter of the $emit method can define the content passed from the child component to the parent component
How to get this content in the parent component 2.1 The method of the parent component has no custom parameters, you can get it by directly adding this parameter in the method of the parent component 2.2 The parent component has custom parameters, you can pass in the event or get the child component the data passed. The data passed by the subcomponent can also be obtained through the event. passevent can also get the data passed by the subcomponent . Only the first parameter can be passed through event.