发布于 3年前

Unexpected space between function name and paren

eslint检验哪里不对?

  loadMore () {
    this.loading = true
    setTimeout (() => {
      let last = this.list[this.list.length - 1]
      for (let i = 1; i <= 10; i++) {
        this.list.push(last + i)
      }
      this.loading = false
    }, 2500)
  }
error  in ./src/views/index.vue

  ✘  http://eslint.org/docs/rules/func-call-spacing  Unexpected space between function name and paren
  /Users/wscart/Sites/node/toutiao/src/views/index.vue:92:5
      setTimeout (() => {
       ^

✘ 1 problem (1 error, 0 warnings)

解决方案

在函数setTimeout名称与括号之间存在空格。 loadMore () 之间的空格去掉

©2020 edoou.com   京ICP备16001874号-3