1.重复跳转报错问题
在router=>index.js中添加
//解决router重复点击报错的问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
2.怎样才能允许重复跳转(跳转相同路由时,刷新当前路由)
this.$router.push({path:'路径',query:{time:Date.now()}})
然后再router-view中加
<router-view :key="$router.query.time" />