vue-slick
vue-slick copied to clipboard
Some methods don't work
@afterChange="handleAfterChange" @beforeChange="handleBeforeChange" @setPosition="handleSetPosition"
These methods doen't work, in the vue.js.
I get the following warning:
[Vue tip]: Event "afterchange" is emitted in component <Slick> at /Users/staskjs/Projects/vue-slick/src/slickCarousel.vue but the handler is registered for "afterChange". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "after-change" instead of "afterChange".
Can someone help me out?
I think @staskjs should take in account this https://stackoverflow.com/a/50423976/1335188
I did a pull request that should solve this issue. Meanwhile you can listen to events anyway with something like
mounted() {
const thumbnails = this.$refs['slider-nav-thumbnails'];
thumbnails.$on('afterChange', this.handleAfterChange);
},
methods: {
handleAfterChange(payload) {
console.log(payload);
}
},
@enricodeleo was your pull request ever merged into the repo? As this still seems to be an issue with the latest version. Solved it woth your comment for now
@enricodeleo was your pull request ever merged into the repo? As this still seems to be an issue with the latest version. Solved it woth your comment for now
Actually it's still pending https://github.com/staskjs/vue-slick/pull/90 maybe not the most important merge to do, bust still it'd be useful for many
Cool, then I'll leave it as is for now and check back again in a while. Thanks a lot for the quickfix and the PR!