nuxt-swiper
nuxt-swiper copied to clipboard
Support with Storybook
I'm trying to get the components provided by nuxt-swiper
working in a Storybook context. However, there is nothing exported from the package that allows for the components to be resolved. This could be down to the Storybook framework I am using (@storybook/vue3-vite
), but we have solved this by manually resolving the components ourselves. This isn't possible with the current module as those components are not exported.
If components were exported it would be possible to do something like
export const SwiperResolver: ComponentResolver = name => {
if (['Swiper', 'SwiperSlide'].includes(name)) {
return { as: name, from: 'nuxt-swiper', name }
}
}
Has anyone else come across this or has a workaround? I'm happy to provide examples to give more context around this issue if needed.
Thanks in advance :)
Question. Are you using nuxt? The reason I ask is this module just makes it to where it auto imports using nuxt's auto-imports
. if storybook can't support auto import then I don't see this working.
Also if you just want to import them directly from import {Swiper, SwiperSlide } from 'swiper/vue'
.