What about the nodes in ast (Abstract Syntax Tree) to VirtualDom?

problem description

you need to convert the ast of vue to virtualDOm,. What should you do with such a div that contains text nodes and element nodes?

related codes

/ / Please paste the code text below (do not replace the code with pictures)

clipboard.png

what result do you expect? What is the error message actually seen?

construct ast into virtualDom tree, and restore it to normal dom

after mounting.
Jan.26,2022

has been resolved. For the text node to save the content of the text, for the element node to be recursive down, after the virtualDom is generated, the text node is restored using document.createTextNode, and the element node is still handled in the normal way. The whole process has been run through https://github.com/xikou1314/kv

.
Menu