Skip to content

Instantly share code, notes, and snippets.

@harrybeckwith
Created April 3, 2019 13:00
Show Gist options
  • Save harrybeckwith/5e50900285a043d30c92df2f93799a6e to your computer and use it in GitHub Desktop.
Save harrybeckwith/5e50900285a043d30c92df2f93799a6e to your computer and use it in GitHub Desktop.
app.vue file for full working version
<template>
<section>
<h2>Light box</h2>
<LightBox
:thumbnails="lightbox.images.thumbnails"
:largeImages="lightbox.images.large"
:thumbnailsPath="lightbox.thumbnailsPath"
:largePath="lightbox.largePath"
:captions="lightbox.captions"
class="lightBox"
/>
<hr>
</section>
</template>
<script>
import LightBox from "@/components/LightBox.vue";
export default {
name: "app",
data() {
return {
lightbox: {
images: {
thumbnails: ["1.jpg", "2.jpg", "3.jpg"],
large: ["1.jpg", "2.jpg", "3.jpg"]
},
captions: ["caption 1", "caption 2", "caption 3"],
thumbnailsPath: "/img/sea/thumbnails/",
largePath: "/img/sea/large/"
}
};
},
components: {
LightBox
}
};
</script>
<style lang ="scss">
.light-box {
&__thumbnail {
margin: 20px;
width: 200px;
}
}
img {
max-width: 100%;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment