在router中重写push
VueRouter.prototype.push = function(location,resolve,reject){ if(resolve && reject){ orginPush.call(this,location, resolve,reject) }else{ orginPush.call(this,location,()=>{},()=>{}) } }
let orginReplace = VueRouter.prototype.replace VueRouter.prototype.replace = function(location,resolve,reject){ if(resolve && reject){ orginReplace.call(this,location, resolve,reject) }else{ orginReplace.call(this,location,()=>{},()=>{}) } }
标签:转报,点击,resolve,call,location,VueRouter,reject,orginReplace,路由 From: https://www.cnblogs.com/sgj191024/p/17583730.html