K
K
killwayne2019-04-26 14:29:25
Slick
killwayne, 2019-04-26 14:29:25

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

1 answer(s)
0
0xD34F, 2019-07-27
@killwayne

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-slidein 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 question

Ask a Question

731 491 924 answers to any question