-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
Closed
Labels
Description
code
由于router,对跳转的路由没有改变时,不会触发页面刷新,所以需要使用其他方式去触发,以下是我的解决方案,利用vue-element-admin本身实现当前路由刷新的方案。
// 添加 view 入参
toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]
if (latestView) {
this.$router.push(latestView)
} else {
// 添加一层判断,当前页是否为首页
if (view.name=== 'Dashboard') this.$router.push('/redirect' + view.fullPath)
// You can set another route
else this.$router.push('/')
}
},