❓ What is correct way to get parent #7990
Replies: 2 comments 12 replies
-
// parent component
vm.parent
// parent component html
vm.parent.vnode.el |
Beta Was this translation helpful? Give feedback.
10 replies
Answer selected by
jd-solanki
-
Waht's you |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Playground
In above playground, If you check the console we are getting second log as
.btn-content
because in DOM tooltip's parent element is.btn-content
.I wanted to know, as that is part of Vue component
Button
can we get that component's rootbutton
as parent by something? (Maybe if we can identify if parent is vue component then we can usevm.proxy.$parent.$el
)Current State:
button
here?)Why?
For components like tooltip, we need to get the root parent for the component and actual element for normal HTML element.
Edit 1
Updated playground according to @chenxch's answer. Old Playground
Beta Was this translation helpful? Give feedback.
All reactions