插槽属性中的 Swiper 已弃用 - eslint-plugin-vue

发布于 2025-01-19 13:58:43 字数 1524 浏览 1 评论 0原文

我尝试在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文