Skip to content

Instantly share code, notes, and snippets.

@pooot
Last active February 14, 2018 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooot/1c9b8b26f2dce92fd3bec5e0c77800b1 to your computer and use it in GitHub Desktop.
Save pooot/1c9b8b26f2dce92fd3bec5e0c77800b1 to your computer and use it in GitHub Desktop.
// 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