-
SummaryI am having some refs that change over time: const dragFree = ref(true);
const [emblaRef, emblaApi] = emblaCarouselVue({
dragFree: dragFree,
}); But if the ref value changes, Embla does not seem to listen for those changes. How may I archive to do so? Do I need to destroy the emblaRef and recreate it? E.g. one use-case is enabling/disabling features depending on the viewport, which may change after resizing the window. 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
MickL
Mar 7, 2025
Replies: 1 comment 1 reply
-
@MickL thank you for your question. Try storing the entire options object in your ref and reassign the options object when you want to change options. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the quick reply! This actually works when using
reactve()
orcomputed()
for the whole object:Very cool!