-
Notifications
You must be signed in to change notification settings - Fork 48
/
Figures.vue
54 lines (52 loc) · 860 Bytes
/
Figures.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 class="figure">
<div class="fg">
<div class="fgimg">
<img :src="pngSrc" />
</div>
</div>
<div class="fgtitle">
<p>
图 {{figure}}:
<slot></slot>
</p>
</div>
</div>
</template>
<script>
export default {
props: ["figure", "type"],
data() {
return {
pngSrc: ""
};
},
created() {
this.locateResources();
},
methods: {
locateResources() {
let tmp = this.figure.split("-");
this.pngSrc = "./figures/ch" + tmp[0] + "/fg" + this.figure + ".jpg";
}
}
};
</script>
<style scoped>
.fg {
border-radius: 6px;
border-width: 2px;
border-style: solid;
border-color: black;
margin: 0 auto;
width: 100%;
}
.fgimg {
padding: 4px 24px 0;
text-align: center;
}
.fgtitle {
text-align: center;
font-weight: bold;
}
</style>