Transition组件包裹的组件内部,获取父节点问题 #8273
Unanswered
2356874721
asked this question in
Help/Questions
Replies: 2 comments 2 replies
-
为什么不考虑用provide/inject呢 |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
代码如上所示,在子组件HelloWorld中,想要获取到父级expose出的属性和方法,因此在子组件中获取父组件实例并打印:

上述三次打印结果中,currentInsance?.parent和currentInsance?.parent?.parent下面的exposed都是null,并且也不是根元素。如下图所示:

Beta Was this translation helpful? Give feedback.
All reactions