AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
关于VUE项目中报NavigationDuplicated: Avoided redundant navigation to current location: "/" 的错 ![](https://img.kancloud.cn/f8/05/f80594f4b45c8d98d67eef674b736232_1228x257.png) 原因:是指路由重复。           虽然对项目无影响,但是看到有红的不舒服! 解决方法: 打开router文件夹下的index.js文件中添加如下代码: ![](https://img.kancloud.cn/47/3e/473e7b2e768b9fc36338901b6e70fc76_781x164.png) ``` //获取原型对象上的push函数 constoriginalPush = VueRouter.prototype.push //修改原型对象中的push方法 VueRouter.prototype.push = functionpush(location) { returnoriginalPush.call(this, location).catch((err) \=>err) } ```