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

init / destroy methods #67

Open
franek8080 opened this issue Apr 21, 2022 · 4 comments
Open

init / destroy methods #67

franek8080 opened this issue Apr 21, 2022 · 4 comments

Comments

@franek8080
Copy link

Great piece of work!
I was wondering how to init / destroy carousel on specific breakpoints as there are no such methods in the documentation. Would appreciate help.
Thanks!

@weotch
Copy link
Member

weotch commented Apr 21, 2022

Thank you!

Can you tell me more about your use case?

If you check out the first example on https://vue-ssr-carousel.netlify.app/misc, it disables the carousel-ness when there aren't enough slides for the slides-per-page of your current breakpoint. I'm wondering, in particular, if that feature will fit your needs or not.

@franek8080
Copy link
Author

I would need exactly opposite behavior (disabled on mobile, active on desktop). But this is not the point. The point is to be able to programmatically init/destroy carousel. For example like this:
https://flickity.metafizzy.co/api.html#destroy (manually)
or
https://splidejs.com/guides/options/#destroy (with breakpoints)

@weotch
Copy link
Member

weotch commented Apr 22, 2022

I still don't understand why you would need to init or destroy manually.

Also, such an API doesn't feel very Vue-y to me. Like if you don't want to use vue-ssr-carousel at some breakpoint, I think you would just wrap it in a v-if that is bound to some variable you update based on the window width.

@franek8080
Copy link
Author

True, but with v-if you would loose the markup.
Manually destroy for a scenario when you do not want a carousel but a set of static element.

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