Vue project error: error'scope' is defined but never used vue/no-unused-vars

An error is reported when running the Vue projecterror 'scope' is defined but never used vue/no-unused-vars

The error is caused here

<template slot="header" slot-scope="scope">
  <el-input v-model="search" placeholder="请输入关键字搜索"/>
</template>

method one

Modify the package.jsonfile in WebStorm and modify rulesit as follows:

"rules": {
    
    
  "no-console": "off",
  "no-unused-vars":"off",
  "no-debugger": "off"
}

Run again, sometimes there is, sometimes not. It's a headache!

Method Two

According to the very effective method found on the official GitHub issue, change it to the following:

<template slot="header" slot-scope="{}">
  <el-input v-model="search" placeholder="请输入关键字搜索"/>
</template>

Run, no more errors!

Guess you like

Origin blog.csdn.net/qq_27198345/article/details/113086230