插槽属性中的 Swiper 已弃用 - eslint-plugin-vue
我尝试在VUE中解决导航刷刀片,并找到了本文来解决它。但是,插槽有一个问题,我知道Vue3有v-slot可以替换此功能,但我不知道该如何编写。这是该文章的链接。 https:// >
版本:
VUE:3.2.31
Vue-Awese-Swiper:5.0.0
swiper:6.8.4
Eslint:8.12.0,
<swiper
ref="mySwiper"
:options="swiperOption"
>
<swiper-slide v-for="(img, index) in images" :key="index">
<img :src="require(`@/assets/picture/${img}.jpg`)"/>
</swiper-slide>
<div class="swiper-button-prev" slot="button-prev" @click="prev"></div>
<div class="swiper-button-next" slot="button-next" @click="next"></div>
</swiper>
此外,我发现了这个也许是Eslint问题,所以我用本文写了Eslint
离子 - `slot' a>
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-deprecated-slot-attribute': 'off',
"vetur.validation.template": false,
}
}
感谢您的帮助。
I try to solve navigation swiper in vue, and I found this article to solve it. However, there's a problem with slot, I know that vue3 has v-slot to replace this function, but I don't know how to write it. Here is the link to the article. https://blog.csdn.net/qq_41838215/article/details/109106235
Version:
vue : 3.2.31
vue-awesome-swiper: 5.0.0
swiper: 6.8.4
eslint: 8.12.0,
<swiper
ref="mySwiper"
:options="swiperOption"
>
<swiper-slide v-for="(img, index) in images" :key="index">
<img :src="require(`@/assets/picture/${img}.jpg`)"/>
</swiper-slide>
<div class="swiper-button-prev" slot="button-prev" @click="prev"></div>
<div class="swiper-button-next" slot="button-next" @click="next"></div>
</swiper>
Besides, I found this maybe eslint problem, so I wrote eslint with this article
ionic - `slot` attributes are deprecated - eslint-plugin-vue
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended'
],
parserOptions: {
parser: 'babel-eslint'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'vue/no-deprecated-slot-attribute': 'off',
"vetur.validation.template": false,
}
}
Thanks for your helping.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论