admin管理员组文章数量:1612098
vue-router 报错Error: Avoided redundant navigation to current location: "/index/user"解决方式
- 问题描述
- 解决方式
问题描述
使用element-ui制作的导航菜单,连续点击同一个导航时,报错
该报错不影响功能(… 影响强迫症…)
如图
当前地址 http://localhost:8080/#/index/user
连续点击–用户列表
跳转至同一地址 http://localhost:8080/#/index/user
出现报错
解决方式
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
// router文件夹-->index.js文件
//cv以下代码解决路由地址重复的报错问题(一劳永逸)
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
版权声明:本文标题:vue-router 报错Error: Avoided redundant navigation to current location: “indexuser“解决方式 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1728628663a1166822.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论