如何访问组件 "build.after" [Glide.js v 3.1.0] 中的尺寸



不知道我应该如何使用组件。我没有使用模块化构建。

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()

您无权访问事件回调中的组件集合。您必须改为创建自定义组件。文档中的详细信息。

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

最新更新