场景
切换导航用户/组织id后,i需要刷新所在页面。
ctrl+f5/window.reload会页面刷新,但可以vue内部实现。
1空白页
2 引入公共head所在跳转页
methods:{
changeOrg(item) {
//设置本地
localStorage.setItem('curOrg', item.id)
//执行store有时没触发
this.$store.dispatch('update',JSON.parse(JSON.stringify(item)))
// 跳转其他页面再返回
this.$router.push({
name:'back',
params:{
link:this.$route.path//当前路由
}
})
},
}
route.js
{
//全局刷新
path: '/back',
name: 'back',
component: () =>
import ('@/views/空白页'),
}
参考资料
https://blog.csdn.net/qq_16772725/article/details/80467492