vue-router.esm.js?3423:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location:xxxx
解决方法
在跳转之前判断一下跳转路径中是否包括本次路径

  itemClick() {
      if(!this.$route.path.includes(this.path)){
        //当前路径中不包括本path就执行
       this.$router.push(this.path);
      }
      // else{
      //   console.log('重复点击');
      // }   
    },
Logo

Vue社区为您提供最前沿的新闻资讯和知识内容

更多推荐