Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ESLint VueJS v-slot

I got an issue with Eslint using modifiers in v-slot

I've try to follow the answer by nokazn in this question : 'v-slot' directive doesn't support any modifier And the documentation of lint for vuejs https://eslint.vuejs.org/rules/valid-v-slot.html

I add in my .eslintrc.js file :

'vue/valid-v-slot': ['error', {
  allowModifiers: true,
}],

But i got the following error in the validation of the lint file :

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

What I try to get accepted by lint is the following code :

<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>

(note that this code is working beside the lint error)

like image 982
CharybdeBE Avatar asked Nov 16 '20 15:11

CharybdeBE


1 Answers

Same issue here: use "vue/valid-v-slot": "off" work for me!

<template  v-slot:[`item.monto`]='{ item }'>
          ${{ formatCLP(item.monto) }}
        </template>
like image 159
Visaka Devi Avatar answered Oct 31 '22 00:10

Visaka Devi