vue-ssr-carousel icon indicating copy to clipboard operation
vue-ssr-carousel copied to clipboard

init / destroy methods

Open franek8080 opened this issue 2 years ago • 4 comments

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!

franek8080 avatar Apr 21 '22 12:04 franek8080

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.

weotch avatar Apr 21 '22 16:04 weotch

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)

franek8080 avatar Apr 22 '22 07:04 franek8080

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.

weotch avatar Apr 22 '22 12:04 weotch

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.

franek8080 avatar Apr 22 '22 13:04 franek8080