The route that this.$router.push jumps is different from the route that watch listens to?


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");
        }
      }
May.08,2022

can you post the console result, and what is the operation of routing the path with store

Menu