2

Not sure how I should use components. I'm not using a modular build.

import Glide from '@glidejs/glide'

var glide = new Glide('.glide')

glide.on('build.after', function() {
  // How do I access the component Sizes and the property slideWidth here?
})

glide.mount()

1 Answers1

0

You do not have access to the collection of components in events callbacks. You have to create a custom component instead. More info in documentation.

var Example = function (Glide, Components, Events) {
  return {
    mount () {
      // Here you can access `Sizes` module
      console.log(Components.Sizes)
    }
  }
}

new Glide('.glide').mount({
  'Example': Example
})
Jędrzej Chałubek
  • 1,410
  • 1
  • 16
  • 29