關於VUE項目中報Error: Avoided redundant navigation to current location: 的錯

在VUE中路由遇到Error: Avoided redundant navigation to current location:報錯顯示是路由重複,

粘貼圖片

雖然對項目無影響,可是看到有紅的仍是不舒服。

因而查了一下發現能夠這樣解決javascript

router文件夾下面的index.js中加上下面幾句代碼java

 

const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}
 

粘貼圖片

相關文章
相關標籤/搜索