BKWLD / vue-ssr-carousel

A performance focused Vue carousel designed for SSR/SSG environments.
https://vue-ssr-carousel.netlify.app
MIT License
132 stars 16 forks source link

Slider doesn't work with Nuxt 2 #80

Closed ErriourMe closed 2 years ago

ErriourMe commented 2 years ago

I have a problem with this slider in Nuxt 2.15.8. I added module in buildModules, then called <ssr-carousel> component:

<ssr-carousel ref="reviewsSlider" class="virtual-slider">
  <div
    v-for="(item, i) in data"
    :key="`review-item-${i}`"
    class="slide"
  >
    <ReviewItem
        class="reviews-block__item-card"
        :data="item"
        :index="i"
        has-image
        @selectedItem="showFull"
      />
  </div>
</ssr-carousel>

After that I'm receiving error (as if the module is not loaded)

Unknown custom element: \<ssr-carousel> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Why?

ErriourMe commented 2 years ago

All works if load component directly:

components: {
    ...
    SsrCarousel: () => import('vue-ssr-carousel'),
  },
weotch commented 2 years ago

Huh, it's working fine for me with the buildModules load style 🤷