The router-link address in vue changes but the page does not refresh

Problem description: Clicking the recommended article link router-link on the article details page will change the id value of details/id on the url, but the page does not refresh and needs to be refreshed manually to change to the page details after the click.

Solution: Find App.vue in the root directory and set the key attribute value of router-view to $route.fullPath

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

Guess you like

Origin blog.csdn.net/m0_53703061/article/details/129941376