Vue

跳转路由成功 但是出现报错

2020-05-15  本文已影响0人  兜兜里冒糖糖

vue-router.esm.js?fe87:2051 Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/numOrderDetail/PT_13169441589513597561/7") is not allowed", stack: "Error↵ at new NavigationDuplicated (webpack-int…/node_modules/vue/dist/vue.common.dev.js:1859:26)"}


image.png

在写这句的地方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)
}

上一篇下一篇

猜你喜欢

热点阅读