找到src\layout\components\TagsView\index.vue(加上一个判断 if (tags))

moveToCurrentTag() {
      const tags = this.$refs.tag;
      // 解决 undefined is not iterable 
      if(tags){
        this.$nextTick(() => {
          for (const tag of tags) {
            if (tag.to.path === this.$route.path) {
              this.$refs.scrollPane.moveToTarget(tag)
              // when query is different then update
              if (tag.to.fullPath !== this.$route.fullPath) {
                this.$store.dispatch('tagsView/updateVisitedView', this.$route)
              }
              break
            }
          }
        })
       }
    },
 

https://blog.csdn.net/weixin_58101575/article/details/121670863?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164015484316780274156516%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=164015484316780274156516&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduend~default-2-121670863.first_rank_v2_pc_rank_v29&utm_term=+undefined+is+not+iterable&spm=1018.2226.3001.4187

posted on 2021-12-22 14:47  努力才会进步  阅读(1733)  评论(0编辑  收藏  举报