Answer the question
In order to leave comments, you need to log in
Vue-slick, why don't cloned slides respond to @click?
For a day now I have been struggling with the problem that if infinite: true - the cloned slides do not react to any event
. What should I do?
Answer the question
In order to leave comments, you need to log in
Vue-slick is nothing more than a wrapper over the usual slick, so vue knows nothing about cloned slides, it does not create them. Accordingly, event handlers added using vue have nowhere to come from.
Delegate event handling - the handler is hung on the root element of the slider, whether the click was made on the slide is determined by the presence of a class slick-slide
in the ancestors of the target element, the slide number can be determined through an attribute data-slick-index
(or you can assign some of your own classes / attributes to the slides to find out where it was made cry).
https://codesandbox.io/s/vue-template-3d5h7
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question