How to get the vnode of a DOM element in Vue 3.0
P粉377412096
P粉377412096 2024-03-26 11:53:33
0
1
481

As shown in the topic. How to get the vnode by accessing the DOM via document.getElementById(id)?

P粉377412096
P粉377412096

reply all(1)
P粉745412116

I think mapping dom to virtual dom is not a good idea. But if you know what you're doing, then go ahead. You can scan the virtual dom from the root directory and check where each vnode is installed to find the virtual node you are interested in.

There is some information about virtual dom scanning. The author of this article matched component types, but you can match vnode.el.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template