Skip to content

Commit b793338

Browse files
author
Pooya Parsa
committed
Badge pill
1 parent 5453a56 commit b793338

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

components/badge.vue

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,36 @@
11
<template>
2-
<span :class="['badge',labelVariant,labelType]">
2+
<span :class="['badge',badgeVariant,badgeType,badgePill]">
33
<slot></slot>
44
</span>
55
</template>
66

77
<script>
8-
export default {
9-
replace: true,
10-
computed: {
11-
labelVariant() {
12-
return !this.variant || this.variant === `default` ? `badge-default` : `badge-${this.variant}`
13-
},
14-
labelType() {
15-
return !this.type ? `` : `tag-${this.type}`
16-
}
17-
},
18-
props: {
19-
variant: {
20-
type: String,
21-
default: 'default'
22-
},
23-
type: {
24-
type: String,
25-
default: ''
26-
}
8+
export default {
9+
replace: true,
10+
computed: {
11+
badgeVariant() {
12+
return !this.variant || this.variant === `default` ? `badge-default` : `badge-${this.variant}`;
13+
},
14+
badgeType() {
15+
return !this.type ? `` : `badge-${this.type}`;
16+
},
17+
badgePill(){
18+
return this.pill ? 'badge-pill' : '';
19+
}
20+
},
21+
props: {
22+
variant: {
23+
type: String,
24+
default: 'default'
25+
},
26+
type: {
27+
type: String,
28+
default: ''
29+
},
30+
pill: {
31+
type: Boolean,
32+
default: false
33+
}
34+
}
2735
}
28-
}
2936
</script>

0 commit comments

Comments
 (0)