1
1
import { mergeData } from 'vue-functional-data-merge'
2
+ import { getConfigComponent } from '../../utils/config'
2
3
import pluckProps from '../../utils/pluck-props'
3
4
import { concat } from '../../utils/array'
4
5
import { keys } from '../../utils/object'
5
6
import { addClass , removeClass } from '../../utils/dom'
6
7
import BLink , { propsFactory as linkPropsFactory } from '../link/link'
7
8
9
+ const NAME = 'BButton'
10
+
8
11
const btnProps = {
9
12
block : {
10
13
type : Boolean ,
@@ -20,7 +23,7 @@ const btnProps = {
20
23
} ,
21
24
variant : {
22
25
type : String ,
23
- default : null
26
+ default : getConfigComponent ( NAME , 'variant' )
24
27
} ,
25
28
type : {
26
29
type : String ,
@@ -85,7 +88,7 @@ function isNonStandardTag(props) {
85
88
// Compute required classes (non static classes)
86
89
function computeClass ( props ) {
87
90
return [
88
- props . variant ? `btn-${ props . variant } ` : `btn-secondary `,
91
+ `btn-${ props . variant || getConfigComponent ( NAME , 'variant' ) } ` ,
89
92
{
90
93
[ `btn-${ props . size } ` ] : Boolean ( props . size ) ,
91
94
'btn-block' : props . block ,
@@ -136,7 +139,7 @@ function computeAttrs(props, data) {
136
139
137
140
// @vue /component
138
141
export default {
139
- name : 'BButton' ,
142
+ name : NAME ,
140
143
functional : true ,
141
144
props,
142
145
render ( h , { props, data, listeners, children } ) {
0 commit comments