vue router點擊自身報錯

點擊沒問題 如果再這個頁面 再點擊一次這個頁面的導航  router-link 就會報這個錯 但不影響功能

引用vue-router的頁面添加一段代碼
 

import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章