Skip to content

Commit 428d515

Browse files
authored
Update badge.js
1 parent 0347bf1 commit 428d515

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/badge/badge.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { mergeData } from 'vue-functional-data-merge'
2-
2+
import { getConfigComponent } from '../../utils/config'
33
import pluckProps from '../../utils/pluck-props'
44
import Link, { propsFactory as linkPropsFactory } from '../link/link'
55

6+
const NAME = 'BBadge'
7+
68
let linkProps = linkPropsFactory()
79
delete linkProps.href.default
810
delete linkProps.to.default
@@ -15,7 +17,7 @@ export const props = {
1517
},
1618
variant: {
1719
type: String,
18-
default: 'secondary'
20+
default: getConfigComponent(NAME, 'variant')
1921
},
2022
pill: {
2123
type: Boolean,
@@ -25,7 +27,7 @@ export const props = {
2527

2628
// @vue/component
2729
export default {
28-
name: 'BBadge',
30+
name: NAME,
2931
functional: true,
3032
props,
3133
render(h, { props, data, children }) {
@@ -34,7 +36,7 @@ export default {
3436
const componentData = {
3537
staticClass: 'badge',
3638
class: [
37-
!props.variant ? 'badge-secondary' : `badge-${props.variant}`,
39+
`badge-${props.variant || getConfigComponent(NAME, 'variant')}`,
3840
{
3941
'badge-pill': Boolean(props.pill),
4042
active: props.active,

0 commit comments

Comments
 (0)