-
Notifications
You must be signed in to change notification settings - Fork 18
/
App.vue
54 lines (48 loc) · 878 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<div
id="app"
>
<div>
<ul
style="margin: 0; padding: 0"
>
<li
v-for="(image, index) in media"
:key="index"
style="display: inline-block; margin: 0 5px 5px 0"
>
<img
:src="image.thumb"
style="height: 100px; cursor: pointer"
@click="openGallery(index)"
>
</li>
</ul>
<LightBox
ref="lightbox"
:media="media"
:show-caption="true"
:show-light-box="false"
/>
</div>
</div>
</template>
<script>
import LightBox from 'components/LightBox'
import media from './media'
export default {
components: {
LightBox,
},
data () {
return {
media,
}
},
methods: {
openGallery(index) {
this.$refs.lightbox.showImage(index)
}
}
}
</script>