drewjbartlett / vue-flickity

A Vue Slider / Carousel Component for Flickity.js
http://drewjbartlett.com/demos/vue-flickity/
374 stars 55 forks source link

Work with bgLazyLoad #7

Closed cpury closed 7 years ago

cpury commented 7 years ago

Great package!

To get bgLazyLoad: true to work, I need to install https://github.com/metafizzy/flickity-bg-lazyload . I tried installing it via npm install flickity-bg-lazyload --save, but my data-flickity-bg-lazyload attributes just get ignored.

Have you tried using add-on packages like this? Any ideas how to get them to work?

Thanks!

cpury commented 7 years ago

Ok I got it to work. Simply imported flickity-bg-lazyload in my component after importing vue-flickity. It then patches the existing Flickity variable.

Of course that's not the cleanest way of doing this, maybe you want to consider adding some nicer API 😃

pmochine commented 5 years ago

Thanks! Just for future readers:

import VueFlickity from 'vue-flickity';
require('flickity-bg-lazyload');