Skip to content

Instantly share code, notes, and snippets.

@meetzaveri
Created March 21, 2018 08:17
Show Gist options
  • Save meetzaveri/ec90fa4ad86d139d7bc4af296da5b148 to your computer and use it in GitHub Desktop.
Save meetzaveri/ec90fa4ad86d139d7bc4af296da5b148 to your computer and use it in GitHub Desktop.

Diffing

first off there's no first class concept in vue of "navigating" to a component. There is a concept of "mounting" and "unmounting" components from the vdom tree, though. When reactive data changes, and vue rerenders the tree, it will do a diff of the old tree, to the new tree. At this point it may 1) unmount a component which does not appear in the new tree 2) mount a component that appears in the new tree, but not the old 3) rerender a component which is in both, but who's props have changed

Adding a key will make vue consider two vnodes as different

So the ultimate question is, will vue be mounting your component, and this totally depends on how your routes are setup. spock_vue1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment