-
SummaryIs this a working way to set up multiple plugins when using emblaCarouselVue?
It's not the cleanest but technically it should work? I had previously used the following but unsure which is cleaner.
If applicable, which variants of Embla Carousel are relevant to this question?
Additional informationNo response CodeSandbox exampleNo response |
Beta Was this translation helpful? Give feedback.
Answered by
meirroth
May 5, 2024
Replies: 1 comment 14 replies
-
@richgcook as stated in the docs (please click on the Vue tab for relevant code example) the first approach you mention is correct. You should pass the plugin constructors directly to However, if you want to make it a bit more readable, you can store the plugin options in a variable like so: <script setup>
import emblaCarouselVue from 'embla-carousel-vue'
import Autoplay from 'embla-carousel-autoplay'
const autoplayOptions = { delay: 4000 }
const [emblaRef] = emblaCarouselVue({ loop: true }, [
Autoplay(autoplayOptions)
])
// ...
</script> |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@richgcook Upgrading
embla-carousel-vue
dependency from7.1.0
to8.0.2
fixed the issue 😅https://stackblitz.com/edit/ab-nuxt3-urc5zc?file=package.json