SSENSE / vue-carousel

A flexible, responsive, touch-friendly carousel for Vue.js
https://ssense.github.io/vue-carousel/
MIT License
1.72k stars 504 forks source link

I have a row of images. I have to use this carousel only when device width is small. How to achieve this? Is there any parameter to enable or disable this plugin based on screen width? #597

Open Jayachandran-J-98 opened 2 years ago

Jayachandran-J-98 commented 2 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I have an issue when [...]

Describe the solution you'd like A clear and concise description of what you want to happen. Add any considered drawbacks.

If any, describe the alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Teachability, Documentation, Adoption, Migration Strategy If you can, explain how users will be able to use this and possibly write out a version the docs. Maybe a screenshot or design?

carmmac commented 2 years ago

you can make a computed property like this: isMobileView() { return document.documentElement.clientWidth <= MOBILE_VIEW_MAX_WIDTH; },

then make two blocks in template section - one if isMobile === true (and render carousel), another if not (and render something else).