Vue|VUE router 导航重复点击报错的问题解决方案
现象

Avoided redundant navigation to current location: 避免了对当前位置的冗余导航
解决方案
在 route.js 中添加以下代码
//获取原型对象上的push函数
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
//修改原型对象中的push方法,replace方法就把VueRouter.prototype.push的push换成replace即可
    return originalPush.call(this, location).catch(err => err)
}
    知道、想到、做到、得到
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号