In Vue3, How can I invoke method exposed by child component before child component being mounted? #10426
Unanswered
tnmoon
asked this question in
Help/Questions
Replies: 2 comments
-
I think you should use the state of the |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's no real way to do this, as the mounting process is synchronous. Why would you need to call a method instead of passing expand: true as a prop? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For example, I want to call expand method as soon as a tree component is created. if I use template ref, it will be undefined when I try to access the child component in setup function. if I use onMounted function, the tree component will first be unexpanded when show up, and expanded after a flash.
So, is there any way to call exposed method after child component being created, but before mounted?
Beta Was this translation helpful? Give feedback.
All reactions