“v-slot"指令不支持任何修饰符 [英] 'v-slot' directive doesn't support any modifier

查看:22
本文介绍了“v-slot"指令不支持任何修饰符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 vuetify 的数据表,我们有不同的插槽和一些道具,例如下面

I am using vuetify's datatable, i this we have different slots with some props for example below

<template  #header.data-table-select="{ on, props }">
    <v-simple-checkbox color="purple" v-bind="props" v-on="on"></v-simple-checkbox>
</template>

我也在使用 vue 的 eslint 插件来检查任何错误/错误代码/或任何违规,但如果我在我的文件中使用上面的代码片段,它会给我错误

I am also using vue's eslint plugin to check for any errors/bad code / or any violation , but if i use above code snippet in my file it gives me error

'v-slot' 指令不支持任何修饰符

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

根据这个文档是正确的 https://eslint.vuejs.org/rules/valid-v-slot.html

as per this docs it is right https://eslint.vuejs.org/rules/valid-v-slot.html

但它没有任何例子来说明我们如何处理这种情况

but it don't have any example to how we handle this case

如何删除此警告/或使其正确,而不使其免除

how can i remove this warning/or make it correct way , without making it exemption

谢谢

推荐答案

我在您提供的代码中没有看到任何 v-slot,因此我只能向您展示我的用例.

I don't see any v-slot in the code you provided so I can show you only my usecase.

Eslint 错误:

<template v-slot:item.actions="{ item }">

没有错误:

<template v-slot:[`item.actions`]="{ item }">

这篇关于“v-slot"指令不支持任何修饰符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆