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
| <template>
| <span class="badge" :class="classes">{{ caption }}</span>
| </template>
|
| <script>
| export default {
| props: ['type', 'caption'],
| computed: {
| classes() {
| return {
| 'badge--admin': this.type === 'admin',
| 'badge--author': this.type === 'author',
| };
| },
| },
| };
| </script>
|
| <style>
| .badge {
| display: inline-block;
| padding: 0.5rem 1rem;
| border-radius: 30px;
| background-color: #ccc;
| color: #2e2e2e;
| }
|
| .badge--admin {
| background-color: #810036;
| color: white;
| }
|
| .badge--author {
| background-color: #002c8a;
| color: white;
| }
| </style>
|
|