这个问题很常见,例如我们有这样一个页面
{
name: 'product_manage_view', path: '/product/:id', component: ViewProduct
}
当我们在 /product/1 页面想跳转到 /product/2单页面的时,发现页面并没有刷新。
通过添加 :key 可以解决,需要保证这个 key 是唯一的
<router-view :key="$route.fullPath" class="view-page"></router-view>
