I am trying to use the slick slider in a .vue component but I get an error.
.slick is not a function
I have made all the setup requirements. This is the code am using:
new Vue({
el: '#app',
data: {
slider: null
},
methods: {
selectImage: function () {
//http call here
return images
}
},
mounted: function () {
this.slider = $('.gallery').slick({
animation: true
});
}
});
<div class='gallery'>
<div v-for="img in images" @click="selectImage(img)">
<img v-bind:src="img.url">
</div>
</div>
My phpstorm does not allow ES6 and am suspecting that it might be the issue.
Here is a fiddle with my code: JSfiddle
v-for
. Looking for a slider that does is a nightmare<script type="text/javascript" src="slick/slick.min.js"></script>
slick.css
file