不确定我应该如何使用组件。我没有使用模块化构建。
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()发布于 2019-02-07 02:28:03
您无权访问事件回调中的组件集合。相反,您必须创建自定义组件。有关更多信息,请访问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
})https://stackoverflow.com/questions/52579607
复制相似问题