1. 程式人生 > 實用技巧 >error Unexpected use of comma operator no-sequences解決過程

error Unexpected use of comma operator no-sequences解決過程

error Unexpected use of comma operator no-sequences解決過程

報錯內容:

ERROR in ./pages/course/_id.vue friendly-errors 12:59:17

Module Error (from ./node_modules/eslint-loader/index.js): friendly-errors 12:59:17

E:\java\JavaWorkSpace\OnlineEducation\WebReview\vue-front-1010\pages\course_id.vue
188:60 error Unexpected use of comma operator no-sequences

✖ 1 problem (1 error, 0 warnings)

報錯介面:

解決辦法:

可以看出報錯地方是_id.vue檔案的188行,報錯提示是不期望無序列使用逗號運算子,程式碼更改如下:

    initCourseInfo() {
      courseApi.getCourseInfo(this.courseId)
        .then(response => {
          this.courseWebVo = response.data.data.courseWebVo
          this.chapterVideoList = response.data.data.chapterVideoList
          this.isbuy = response.data.data.isBuy
        })
    },

錯誤位置: