Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.
This repository was archived by the owner on May 8, 2025. It is now read-only.

'v-slot' directive doesn't support any modifier #235

Closed
@sbernard31

Description

@sbernard31

I'm new in vue world.

And I'm currently writing a vue/vuetify application using vscodium as IDE.

I follow the standard way to create my app :

vue create my-app
cd my-app
vue add vuetify

Now in vscodium I get this kind of error :

vue/valid-v-slot]
'v-slot' directive doesn't support any modifier.eslint-plugin-vue

for this kind of code :

<template>
  <v-data-table
    dense
    :loading="loading"
    :headers="headers"
    :items="registrations"
    item-key="endpoint"
    :items-per-page="5"
    class="elevation-1"
    @click:row="openLink"
  >
    <!-- ======= ERROR FOR THIS 2 SLOTS ======== -->
    <template v-slot:item.registrationDate="{ item }">
      {{ new Date(item.registrationDate) | moment("from") }}
    </template>
    <template v-slot:item.lastUpdate="{ item }">
      {{ new Date(item.lastUpdate) | moment("from") }}
    </template>
  </v-data-table>
</template>

Capture d’écran de 2021-02-19 12-02-17

But the code works and it seems I follow the recommended way by vuetify : https://vuetifyjs.com/en/components/data-tables/#item

I checked eslint-plugin-vue issues there is a lot of issue reported related to this.

I also find some kind of workaround :
Using this v-slot:[`item.registrationDate`] instead of v-slot:item.registrationDate seems to make the validator happy.

It seems there is also a kind of fix but it need some configuration : vuejs/eslint-plugin-vue#1330 (comment)

My question are :

  1. is the workaround the good way to go ? if yes is the vuetify doc should be updated ?
  2. is the configuration the good way to go ? if yes, should it be done by default by a vue-cli plugin for vuetify ?

I ask this question here hoping this is the best place halfway between vuetify and eslint-plugin-vue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions