vue-slick icon indicating copy to clipboard operation
vue-slick copied to clipboard

Some methods don't work

Open pieterjanmaes opened this issue 6 years ago • 4 comments

@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?

pieterjanmaes avatar Jan 16 '19 17:01 pieterjanmaes

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 avatar Jun 11 '19 14:06 enricodeleo

@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

DBZFYAM avatar Mar 22 '20 22:03 DBZFYAM

@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

enricodeleo avatar Mar 22 '20 23:03 enricodeleo

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!

DBZFYAM avatar Mar 23 '20 00:03 DBZFYAM