zoukankan      html  css  js  c++  java
  • vue-router 路由重复点击出错问题

     在路由的js中添加

    import VueRouter from "vue-router";
    // 处理路由重复点击出错问题
    const originalPush = VueRouter.prototype.push;
    VueRouter.prototype.push = function push(location) {
    return originalPush.call(this, location).catch(err => err);
    };

    const originalReplace = VueRouter.prototype.replace;
    VueRouter.prototype.replace= function replace(location) {
    return originalReplace.call(this, location).catch(err => err);
    };
    // 处理路由重复点击出错问题
  • 相关阅读:
    hdoj:2075
    hdoj:2072
    hdoj:2071
    hdoj:2070
    hdoj:2069
    test001
    hdoj:2067
    hdoj:2061
    hdoj:2058
    hdoj:2057
  • 原文地址:https://www.cnblogs.com/rchao/p/15337229.html
Copyright © 2011-2022 走看看