// 全局
const routerPush =VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
if(typeof(location)=="string"){
var Separator = "&";
if(location.indexOf('?')==-1) { Separator='?'; }
location = location + Separator + "random=" + Math.random();
}
return routerPush.call(this, location).catch(error=> error)
}
//单个
router.push('/admin').catch(err=>err)
vue重写路由push方法
最新推荐文章于 2023-08-07 11:44:40 发布