Vue.js – update router view

This happens when you enter a route you are already on, and the component is not reloaded, even though the parameters are different. Change your router-view to:

<router-view :key="$route.fullPath" />

Vue tries to reuse components when possible, which is not what you want in this situation. The key attribute tells Vue to use a different instance of a component for each unique key rather than reusing one. Since the path is different for each set of parameters, that will make a good key.

Leave a Comment