commit | author | age
|
4f1007
|
1 |
<template> |
CM |
2 |
<span class="badge" :class="classes">{{ caption }}</span> |
|
3 |
</template> |
|
4 |
|
|
5 |
<script> |
|
6 |
export default { |
|
7 |
props: ['type', 'caption'], |
|
8 |
computed: { |
|
9 |
classes() { |
|
10 |
return { |
|
11 |
'badge--admin': this.type === 'admin', |
|
12 |
'badge--author': this.type === 'author', |
|
13 |
}; |
|
14 |
}, |
|
15 |
}, |
|
16 |
}; |
|
17 |
</script> |
|
18 |
|
|
19 |
<style scoped> |
|
20 |
.badge { |
|
21 |
display: inline-block; |
|
22 |
padding: 0.5rem 1rem; |
|
23 |
border-radius: 30px; |
|
24 |
background-color: #ccc; |
|
25 |
color: #2e2e2e; |
|
26 |
} |
|
27 |
|
|
28 |
.badge--admin { |
|
29 |
background-color: #810036; |
|
30 |
color: white; |
|
31 |
} |
|
32 |
|
|
33 |
.badge--author { |
|
34 |
background-color: #002c8a; |
|
35 |
color: white; |
|
36 |
} |
|
37 |
</style> |