I just started using this.$emit event, but the child component cannot trigger the event, so the data of the child component cannot be obtained using this method.
I found out by accident today that I can directly use the following method to obtain it, simple and easy to use
This is my subcomponent:
Parent component:
use:
effect:
to sum up:
That is, define a ref when calling the child component, and then use this.$refs.child. attribute
extend:
Then, if the child component wants to get the data and methods in the parent component, you can use it in the child component:
this.$parent.data
this.$parent.method