解决vue-router重复点击路由报Uncaught (in promise) NavigationDuplicated Avoided redundant navigation to current location的问题
问题
在 Vue 项目中,当我们 重复点击相同路由 时,会出现 Uncaught (in promise) NavigationDuplicated Avoided redundant navigation to current location 的问题。
%20NavigationDuplicated%20Avoided%20redundant%20navigation%20to%20current%20location%E7%9A%84%E9%97%AE%E9%A2%98/bug.jpg)
解决
在 router/index.js
文件下,添加如下代码即可:
1 | const originalPush = VueRouter.prototype.push; |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 LqZww's blog!
评论
ValineLivere