javascript - ESLint VueJS v-slot

标签 javascript vuejs2 eslint v-slot

我在使用 v-slot 中的修饰符时遇到了 Eslint 的问题
我尝试在这个问题中遵循 nokazn 的答案:
'v-slot' directive doesn't support any modifier
以及 vuejs 的 lint 文档
https://eslint.vuejs.org/rules/valid-v-slot.html
我添加了我的.eslintrc.js文件 :

'vue/valid-v-slot': ['error', {
  allowModifiers: true,
}],
但我在验证 lint 文件时遇到以下错误:
Configuration for rule "vue/valid-v-slot" is invalid:
    Value [{"allowModifiers":true}] should NOT have more than 0 items.
我试图让 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>
(请注意,此代码在 lint 错误旁边有效)

最佳答案

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

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

关于javascript - ESLint VueJS v-slot,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64860946/

相关文章:

javascript - CSS - 线性渐变在背景属性中不起作用

javascript - 使用 vuex 从其他组件更改 v-model 的值

webpack - 将 eslint-webpack-plugin 添加到项目中以提供 Typescript linting

vue.js - 在 Vue 2 中处理损坏的图像 url 时如何处理无限的 GET Image 请求?

reactjs - typescript react 组件中的 react / Prop 类型eslint错误

javascript - Webpack 在使用 npm 链接时给出 eslint 错误

javascript - JSLint 错误 : Undeclared 'Image' , 未声明 'Document' ,超出范围

javascript - pug(jade) 中的错误不显示布局中的内容

javascript - 显示和隐藏选择菜单选项

javascript - 是否可以将 FormData 对象中的文件列表和整个 json 对象发送到 ASP.NET CORE MVC Controller