Created
April 16, 2018 15:43
-
-
Save AlanJenkinsVS/b1f3532b9f19cf7b8548861a74b235e5 to your computer and use it in GitHub Desktop.
4. Cleaner Views - Vue JS Optimisation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Add a key to router view. This tells Vue to re-render the view from scratch. | |
While this has negligibly worse performance from route to route it does simplify the | |
component as you no longer need to reset starting variables, etc within the component. | |
*/ | |
<router-view :key="$route.fullPath"></router-path> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment