this.$router.push跳转的路由和watch监听的路由不一样?

图片描述
图片描述

watch: {
      $route(newVal, oldVal){
        console.log(newVal.path)
        this.setTags(newVal);
      }
    },
 closeTags(index) {
        const delItem = this.tagsList.splice(index, 1)[0];
        const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];
        if (item) {
          console.log(item.path)
          delItem.path === this.$route.fullPath && this.$router.push(item.path);
        }else{
          this.$router.push('/main');
        }
      }
阅读 4.1k
1 个回答

console结果可以贴一下么,而且用store传路由路径是什么操作

推荐问题