Calling $parent from an async component. #10723
-
|
A component loaded asynchronously is automatically wrapped by an Example of the issue: Calling I know it's discouraged to call parent methods directly this way - and going by |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Alright, I'll answer my own question in hopes for other backend developers intruding into frontend community - like myself - to find the answer, long story short the answer is not by Thus you can directly access ancestor components' data, props and, methods without worrying about other components taking place in between like the |
Beta Was this translation helpful? Give feedback.
Alright, I'll answer my own question in hopes for other backend developers intruding into frontend community - like myself - to find the answer, long story short the answer is not by
$emitting events, the answer is by usingprovidein components higher in the hierarchy and,injectin their descendant components like documented here.Thus you can directly access ancestor components' data, props and, methods without worrying about other components taking place in between like the
AsyncComponentWrappermentioned in this questions, there are some caveats to look out for but, all is documented in the mentioned reference.