美文网首页Vue
跳转路由成功 但是出现报错

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

作者: 兜兜里冒糖糖 | 来源:发表于2020-05-15 14:27 被阅读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)
    }

    相关文章

      网友评论

        本文标题:跳转路由成功 但是出现报错

        本文链接:https://www.haomeiwen.com/subject/fjytohtx.html