swiper icon indicating copy to clipboard operation
swiper copied to clipboard

vue3 ts swiper module component props, Type 'true' cannot be assigned to type 'undefined'

Open lxfxy opened this issue 3 years ago • 2 comments

Check that this is really a bug

  • [X] I confirm

Reproduction link

https://codesandbox.io/s/friendly-chihiro-nqj9n

Bug description

<script setup lang="less">
import { Swiper, SwiperSlide } from "swiper/vue";
import { FreeMode, Scrollbar } from "swiper";
import "swiper/css";
import "swiper/css/free-mode";
import "swiper/css/scrollbar";
</script>

<template>
<Swiper
    :modules="[FreeMode, Scrollbar]"
    freeMode
    scrollbar
>
     // ......
</Swiper>
</template>

code

code-err-msg

Expected Behavior

There are some effects. Errors are not reported during development, but errors are reported during build

code-err-msg2

Actual Behavior

No response

Swiper version

7.3.1

Platform/Target and Browser Versions

chrome 96.0.4664.45

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the docs.
  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • [X] Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • [ ] I'm willing to open a PR

lxfxy avatar Dec 03 '21 12:12 lxfxy

also got the same issues, seems like this happen because the default value of the prop is undefined where as the proptype is xxOptions | boolean

hi-reeve avatar Feb 20 '22 12:02 hi-reeve

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 21 '22 04:09 stale[bot]