File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,15 @@ import styles from 'vue-pure-lightbox/dist/VuePureLightbox.css'
126
126
| open-at-index | integer | ** (Optional)** index of an image to show when opening the modal |
127
127
128
128
### Available slots:
129
+
129
130
| Slot | Description | Default |
130
131
| ------------- | ---------------------------------------------------- | ----------------------------------------- |
131
132
| content | DOM to be used in place of an image in the lightbox | < ; img> ; tag with src set to path |
132
133
| loader | DOM to be used when there is an image loading | LightboxDefaultLoader |
133
134
| icon-close | Icon to be used as a close button | × ; (& ; times;) |
134
135
| icon-previous | Icon to be used as the "next" arrow button | ![ ] ( https://i.imgur.com/HcdxJmd.png ) (svg) |
135
136
| icon-next | Icon to be used as the "previous" arrow button | ![ ] ( https://i.imgur.com/oErSVk3.png ) (svg) |
137
+ | preview | DOM to be used in place of the default thumbnail | Clickable link with a thumbnail |
136
138
137
139
## Contents
138
140
This package consists of just one ` .vue ` file. It is meant to be as small and simple as possible.
Original file line number Diff line number Diff line change 17
17
/>
18
18
<img v-else :src =" url" >
19
19
</div >
20
+ <button slot =" preview" slot-scope =" { show }" @click =" show" >
21
+ Open
22
+ </button >
20
23
</Lightbox >
21
24
</template >
22
25
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div >
3
- <a :href =" images[0]" target =" _blank" @click.prevent =" show" class =" lightbox__thumbnail" >
4
- <img :src =" thumbnail" :alt =" alternateText" >
5
- </a >
3
+ <slot name =" preview" :show =" show" >
4
+ <a v-if =" thumbnail" :href =" images[0]" target =" _blank" @click.prevent =" show" class =" lightbox__thumbnail" >
5
+ <img :src =" thumbnail" :alt =" alternateText" >
6
+ </a >
7
+ </slot >
6
8
<div class =" lightbox" v-if =" visible" @click =" hide" >
7
9
<div class =" lightbox__close" @click =" hide" >
8
10
<slot name =" icon-close" >× ; </slot >
53
55
props: {
54
56
thumbnail: {
55
57
type: String ,
58
+ default: null ,
56
59
},
57
60
images: {
58
61
type: Array ,
You can’t perform that action at this time.
0 commit comments