Reputation: 51
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()
Upvotes: 2
Views: 1261
Reputation: 1438
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
})
Upvotes: 0