As shown in the topic. How to get the vnode by accessing the DOM via document.getElementById(id)
?
P粉7454121162024-03-27 09:55:24
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
.