/**
Rewrite the push method of the route
Solve the problem of reporting an error when jumping on the same route
Add, when same route jump, trigger watch (string only, like “view?id=5″)
*/
const routerPush = Router.prototype.push
Router.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)
}
Rewrite the push method of the route
Solve the problem of reporting an error when jumping on the same route
Add, when same route jump, trigger watch (string only, like “view?id=5″)
*/
const routerPush = Router.prototype.push
Router.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)
}