页签问题
Closed this issue · 1 comments
nigiwen commented
当两个路由只有query参数不同时页面无法重新渲染
<!-- key 采用 route.path 和 route.fullPath 有着不同的效果,大多数时候 path 更通用 -->
<router-view v-slot="{ Component, route }">
<transition name="el-fade-in" mode="out-in">
<keep-alive :include="tagsViewStore.cachedViews">
<component :is="Component" :key="route.path" class="app-container-grow" />
</keep-alive>
</transition>
</router-view>
改成下面就可以了。请问大多数时候 path 更通用,能举几个例子吗,如果我用 path 应该怎么修复这个bug
<component :is="Component" :key="route.fullPath" class="app-container-grow" />
pany-ang commented
自行切换即可。但默认为 path 时,在页面中监听路由参数变化也能实现你的需求。