Replies: 1 comment
-
I found a elegant solution: export default defineComponent({
setup() {
const element = document.createElement('div')
const control = new Control({
element
})
control.location = [120, 30]
control.......
return () => h(Teleport, {to: element}......)
}
}) |
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
-
When I use a library who need to put a node to somewhere, as well as render the node's inner with vue, I got this idea.
These library usually just modify the root node for size or absolute position.
For example, in OpenLayers, Control is a kind of Class Component to add a
HTMLElement
into another DOM node.As you can see, you need to do lots of thing in
onMounted
, it is ugly. So what about this:?I believe it's a good feature, and I'd like try to contribute for it.
Beta Was this translation helpful? Give feedback.
All reactions