ESLint VueJS v 槽

Cha*_*eBE 7 javascript eslint vuejs2 v-slot

我在 v-slot 中使用修饰符时遇到 Eslint 问题

我尝试遵循 nokazn 在这个问题中的答案: 'v-slot'指令不支持任何修饰符 以及 vuejs 的 lint 文档 https://eslint.vuejs.org/rules/valid-v-slot .html

我在我的.eslintrc.js文件中添加:

'vue/valid-v-slot': ['error', {
  allowModifiers: true,
}],
Run Code Online (Sandbox Code Playgroud)

但我在验证 lint 文件时遇到以下错误:

Configuration for rule "vue/valid-v-slot" is invalid:
    Value [{"allowModifiers":true}] should NOT have more than 0 items.
Run Code Online (Sandbox Code Playgroud)

我试图让 lint 接受的是以下代码:

<v-data-table
        :headers="headers"
        :items="data"
        disable-pagination
        fixed-header
      >
        <template v-slot:item.EDIT>
          <v-btn icon>
            <v-icon>mdi-pencil</v-icon>
          </v-btn>
        </template>
      </v-data-table>
Run Code Online (Sandbox Code Playgroud)

(请注意,此代码在 lint 错误旁边起作用)

小智 8

同样的问题在这里:"vue/valid-v-slot": "off"为我使用工作!

<template  v-slot:[`item.monto`]='{ item }'>
          ${{ formatCLP(item.monto) }}
        </template>
Run Code Online (Sandbox Code Playgroud)