-
Notifications
You must be signed in to change notification settings - Fork 80
/
App.vue
68 lines (62 loc) · 1.12 KB
/
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<template>
<div
id="app"
style="background-color: yellow"
class="row"
>
<div
v-for="i in [0, 1, 2, 3, 4]"
:key="i"
>
<p>{{ paragraphs[0] }}</p>
<p>{{ paragraphs[1] }}</p>
</div>
<div>
<ul>
<li
v-for="(image, index) in media"
:key="index"
style="display: inline-block"
>
<img
v-lazy="image.src || image.thumb"
style="height: 100px"
@click="openGallery(index)"
>
</li>
</ul>
<LightBox
ref="lightbox"
:media="media"
:show-caption="true"
:show-light-box="false"
:site-loading="siteLoading"
/>
</div>
</div>
</template>
<script>
import LightBox from 'components/LightBox'
import siteLoading from './siteloading.gif'
import {
media,
paragraphs,
} from './dummy'
export default {
components: {
LightBox,
},
data () {
return {
media,
siteLoading,
paragraphs,
}
},
methods: {
openGallery(index) {
this.$refs.lightbox.showImage(index)
}
}
}
</script>