Keywords: $on $emit
<LoginForID v-on:listentoID="getUserID" v-on:listentoPSW="getUserPsw" v-if="which_to_show == 'LoginForID'"></LoginForID>
getUserID and getUserPsw are the methods defined by the methods in the parent component to obtain the data of the child component
The child component needs to monitor the change of the input input value through the change event , trigger the event to notify the parent component and pass the data of the child component as a parameter to the parent component
There are two methods defined by the parent component to get the parameters passed by the child component:
data is the parameter passed from the child component, which is directly copied to the local attribute of the parent component to complete the value transfer