The vue3 parent component uses the method of the child component, and the child component passes the value to the parent component

1. The parent component uses the child component method

The parent component defines the child component instance through ref, and obtains the data and methods of the child component by calling the instance

 

Subcomponents expose objects and methods through defineExpose

 

 2. Subcomponents pass values ​​to parent components

 

 

 

Guess you like

Origin blog.csdn.net/qq_46617584/article/details/130289961
Recommended