banthagroup / fslightbox

An easy to use vanilla JavaScript plug-in without production dependencies for displaying images, videos, or, through custom sources, anything you want in a clean overlying box.
MIT License
351 stars 30 forks source link

vimeo url #168

Open numeralsix opened 3 years ago

numeralsix commented 3 years ago

This is well documented in the vue examples but not in vanilla js. I'm trying to utilize the vanilla js library from vue-3 application.I can make everything work except I am stumped on custom sources, specifically vimeo.

e.g.


require("fslightbox");
....
  this.lightbox = new FsLightbox();
    // set up props, like sources, types, events etc.
    this.lightbox.props.sources = ['example.jpg', 'https://vimeo.com/347119375']
    this.lightbox.props.types = ['image','vimeo'];
    this.lightbox.props.onInit = () => console.log("Lightbox initialized!");
  },
  methods: {
    openLightboxOnSlide: function (number) {
      this.lightbox.open(number);
}
}