zoukankan      html  css  js  c++  java
  • Vue-Router在当前UR不刷新的Debug调试

    如果使用vue-router在当前页面刷新,则会中断此操作,没有反应,错误信息是:

    Error: Avoided redundant navigation to current location: "/".
        at createRouterError (vue-router.esm.js?8c4f:2062)
        at createNavigationDuplicatedError (vue-router.esm.js?8c4f:2035)
        at HTML5History.confirmTransition (vue-router.esm.js?8c4f:2195)
        at HTML5History.transitionTo (vue-router.esm.js?8c4f:2125)
        at HTML5History.push (vue-router.esm.js?8c4f:2492)
        at eval (vue-router.esm.js?8c4f:2913)
        at new Promise (<anonymous>)
        at VueRouter.push (vue-router.esm.js?8c4f:2912)
        at VueRouter.vue_router__WEBPACK_IMPORTED_MODULE_1__.default.push (index.js?a18c:34)
        at handler (vue-router.esm.js?8c4f:1100)
    // 判断路径的路由是否一致
    function
    isSameRoute (a, b) { if (b === START) { return a === b } else if (!b) { return false } else if (a.path && b.path) {
      // 一致的路由,会走到这个位置
    return ( a.path.replace(trailingSlashRE, '') === b.path.replace(trailingSlashRE, '') && a.hash === b.hash && isObjectEqual(a.query, b.query) ) } else if (a.name && b.name) { return ( a.name === b.name && a.hash === b.hash && isObjectEqual(a.query, b.query) && isObjectEqual(a.params, b.params) ) } else { return false } }

     vue-router.esm.js文件中的定位位置,可直接Debug即可

    ,解决其一就是 加个中间页,比如退出登录 ---》 跳转到中间页,显示退出成功 ---》然后再跳转到首页即可

    复制请注明出处,在世界中挣扎的灰太狼
  • 相关阅读:
    php 基础------数组过滤
    js或者jq 使用cookie 时在谷歌浏览器不好使
    css3 -阻止元素成为鼠标事件目标 pointer-events
    CSS3-----transform 转换
    css3---过渡
    css3动画----animation
    移动端尺寸适配--媒体查询
    工作一年总结
    关于Jquery.Data()和HTML标签的data-*属性
    android shape
  • 原文地址:https://www.cnblogs.com/XingXiaoMeng/p/14140769.html
Copyright © 2011-2022 走看看