vueRouter push方法重写
转载// vue相同路由跳转报错问题处理
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
if(onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
return originalPush.call(this, location).catch(err => err)
}
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
如何重写gorm日志(实现自定义慢sql打印)
gorm自定义日志格式,可实现慢sql自定义打印
sql SQL mysql -
vue-router重写push方法,解决相同路径跳转报错
在注册的router.js下新增上面方框中的这些代码import Vue from 'vue'import VueRouter from 'vue-router'//自定义页面im
vue.js elementui javascript Vue User -
jquery push 集合 js push方法
三个编译指令为:page、include、taglib。 七个动作指令为:jsp:forward、jsp:param、jsp:include、jsp:plugin、jsp:useBean、jsp:setPr
jquery push 集合 jsp include applet servlet