Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support with Storybook #95

Open
piercemorris opened this issue Oct 11, 2023 · 1 comment
Open

Support with Storybook #95

piercemorris opened this issue Oct 11, 2023 · 1 comment

Comments

@piercemorris
Copy link

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 :)

@cpreston321
Copy link
Owner

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'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants