Glidejs 如何访问';build.after';[Glide.jsv3.1.0]
不确定我应该如何使用组件。我没有使用模块化构建Glidejs 如何访问';build.after';[Glide.jsv3.1.0],glidejs,Glidejs,不确定我应该如何使用组件。我没有使用模块化构建 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() 您无权访问事件回调中的组件集合。您必须创建一个自定义
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
})