File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { mergeData } from 'vue-functional-data-merge'
2
-
2
+ import { getConfigComponent } from '../../utils/config'
3
3
import pluckProps from '../../utils/pluck-props'
4
4
import Link , { propsFactory as linkPropsFactory } from '../link/link'
5
5
6
+ const NAME = 'BBadge'
7
+
6
8
let linkProps = linkPropsFactory ( )
7
9
delete linkProps . href . default
8
10
delete linkProps . to . default
@@ -15,7 +17,7 @@ export const props = {
15
17
} ,
16
18
variant : {
17
19
type : String ,
18
- default : 'secondary'
20
+ default : getConfigComponent ( NAME , 'variant' )
19
21
} ,
20
22
pill : {
21
23
type : Boolean ,
@@ -25,7 +27,7 @@ export const props = {
25
27
26
28
// @vue /component
27
29
export default {
28
- name : 'BBadge' ,
30
+ name : NAME ,
29
31
functional : true ,
30
32
props,
31
33
render ( h , { props, data, children } ) {
@@ -34,7 +36,7 @@ export default {
34
36
const componentData = {
35
37
staticClass : 'badge' ,
36
38
class : [
37
- ! props . variant ? 'badge-secondary' : `badge-${ props . variant } ` ,
39
+ `badge-${ props . variant || getConfigComponent ( NAME , 'variant' ) } ` ,
38
40
{
39
41
'badge-pill' : Boolean ( props . pill ) ,
40
42
active : props . active ,
You can’t perform that action at this time.
0 commit comments