Skip to content

Minimal documentation and option to delay auto initialization of glidejs #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added option to delay auto initialization of the glidejs instance
  + Helpful if you have to deal with v-for to update dynamic lists
  + Avoids the error "Cannot read property 'classList' of undefined" when using async content
  • Loading branch information
Gabriel Lau committed Jul 5, 2018
commit 386284c1d85e3b6440570d505c6f00c7cb1bbb06
11 changes: 10 additions & 1 deletion src/components/Glide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ export default {
settings: {
type: Object,
default: () => {}
},
delayInitialization: {
type: Boolean,
default: false
}
},

methods: {
go (pattern) {
this.glide.go(pattern)
},
init () {
this.glide.mount()
}
},

Expand All @@ -41,7 +48,9 @@ export default {
})
})

this.glide.mount()
if (!this.delayInitialization) {
this.init()
}
}
}
</script>