As in topic. How I can achieve getting vnode just by accessing DOM by document.getElementById(id)
?
CodePudding user response:
You should use template refs instead of accessing the DOM directly as per your example: https://vuejs.org/guide/essentials/template-refs.html
CodePudding user response:
I don't think this is a good idea to map dom to virtual dom. But if you know what you are doing then go ahead. You can scan through virtual dom from root and check where each vnode is mounted to find one you are interested of.
There is some info about virtual dom scanning. Author of this article matching component types, but you can match vnode.el
.