ismail9k / vue3-carousel

Vue 3 carousel component
https://ismail9k.github.io/vue3-carousel/
MIT License
666 stars 166 forks source link

Navigation component throws TS error when using as described in the docs #236

Closed niekbridge closed 1 year ago

niekbridge commented 1 year ago

Describe the bug Importing the Navigation component as described in the docs throws the following error when using it.

Type '{}' is not assignable to type 'ComponentProps<(props: any, { slots, attrs }: any) => VNode<RendererNode, RendererElement, { [key: string]: any; }>[]>'. Type '{}' is not assignable to type '(props: any, { slots, attrs }: any) => VNode<RendererNode, RendererElement, { [key: string]: any; }>[]'.

I currently import and use the component in the following way:

<script lang="ts" setup>
import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel';
</script>

<template>
  <Carousel>
    <Slide>
      ...
    </Slide>
    <template #addons>
      <Navigation />
    </template>
  </Carousel>
</template>

To Reproduce Steps to reproduce the behavior:

  1. import the Navigation component as described in the docs
  2. create a addons template, as described in the docs
  3. Add the Navigation component in the addons template
  4. See error

Expected behavior No TypeScript error to be thrown

mrdeeds88 commented 11 months ago

I have updated the "vue-tsc" package (to "vue-tsc": "^1.6.5") and it was fixed the problem. Hope this works for you too.