I'm a student and I'm trying to create my own virtual DOM for my college project (it won't have any advanced features like props or events, I'll keep it simple) like other famous frameworks React, Vue and so on.
I just want to know when we have multiple code files (code splitting). If I make a change to any deep child element, do I need to compare the complete virtual DOM (including all child elements and parent elements), or do I only need to compare that child element.
If I have to compare the complete new virtual DOM (including all children) with the previous virtual DOM. So why should I care about re-rendering in React or Vue (since any changes to the child will force the framework to compare the full Virtual DOM)
P粉4208682942024-02-04 13:12:34
For Vue, Virtual DOM works differently in vue2 and vue3.
vue3’s approach is,
references: