Last active
February 14, 2018 15:31
-
-
Save pooot/1c9b8b26f2dce92fd3bec5e0c77800b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// show.blade.php | |
<news-gallery :gallery="{{ $post->getMedia('gallery')"></news-gallery> | |
// Vue component | |
<template> | |
<div class="slick-slider"> | |
<div class="img" | |
v-for="image in images" | |
:style="'background-image:url(' + image.url + ')'"></div> | |
</div> | |
</template> | |
<script> | |
export default { | |
props: { | |
images: { | |
type: Array, | |
required: true | |
} | |
}, | |
mounted() { | |
$('.slick-slider').slick({ | |
lazyLoad: 'progressive', | |
arrows: false, | |
autoplay: true, | |
autoplaySpeed: 3000, | |
fade: true | |
}); | |
} | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment