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传路由路径是什么操作

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题