forked from cypress-io/cypress-documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocsImage.vue
67 lines (62 loc) · 1.05 KB
/
DocsImage.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
<script>
export default {
props: {
alt: {
type: String,
default: '',
},
src: {
type: String,
required: true,
},
title: {
type: String,
default: '',
},
caption: {
type: String,
default: '',
},
noBorder: {
type: Boolean,
default: false,
}
},
computed: {
filePath() {
return require(`../../assets${this.src}`)
},
},
}
</script>
<template>
<div :class="$style.docsImage">
<img
:class="[{ [$style.imageNoBorder]: noBorder }]"
:src="filePath"
:alt="alt || title || caption"
:title="title"
/>
<p v-if="caption" :class="$style.caption">
{{ caption }}
</p>
</div>
</template>
<style module>
.docsImage {
margin-bottom: 1rem;
}
.docsImage img {
border: 1px solid #999 !important;
box-shadow: 0 2px 10px 1px rgba(0, 0, 0, 0.26) !important;
}
.imageNoBorder {
border: none !important;
box-shadow: none !important;
}
.caption {
font-size: 0.85rem;
text-align: center;
margin-top: -0.5rem;
}
</style>