vue中通过路由进行页面跳转时报以下错误:
在这里插入图片描述
原因:在跳转时push了相同的地址

解决:在引入vue-router的文件(router文件夹下的index.js)中加入以下代码即可

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

在这里插入图片描述

Logo

前往低代码交流专区

更多推荐