@@ -119,25 +119,19 @@ export default baseMixins.extend<options>().extend({
119
119
return this . $createElement (
120
120
'div' ,
121
121
{ 'class' : 'v-btn__content' } ,
122
- [ this . $slots . default ! ]
122
+ this . $slots . default
123
123
)
124
124
} ,
125
125
genLoader ( ) : VNode {
126
- const children : VNodeChildren = [ ]
127
-
128
- if ( ! this . $slots . loader ) {
129
- children . push ( this . $createElement ( VProgressCircular , {
130
- props : {
131
- indeterminate : true ,
132
- size : 23 ,
133
- width : 2
134
- }
135
- } ) )
136
- } else {
137
- children . push ( this . $slots . loader )
138
- }
139
-
140
- return this . $createElement ( 'span' , { 'class' : 'v-btn__loading' } , children )
126
+ return this . $createElement ( 'span' , {
127
+ class : 'v-btn__loading'
128
+ } , this . $slots . loader || [ this . $createElement ( VProgressCircular , {
129
+ props : {
130
+ indeterminate : true ,
131
+ size : 23 ,
132
+ width : 2
133
+ }
134
+ } ) ] )
141
135
} ,
142
136
onRouteChange ( ) {
143
137
if ( ! this . to || ! this . $refs . link ) return
@@ -155,10 +149,12 @@ export default baseMixins.extend<options>().extend({
155
149
render ( h ) : VNode {
156
150
const setColor = ( ! this . outline && ! this . flat && ! this . disabled ) ? this . setBackgroundColor : this . setTextColor
157
151
const { tag, data } = this . generateRouteLink ( this . classes )
158
- const children = [ this . genContent ( ) ]
152
+ const children = [
153
+ this . genContent ( ) ,
154
+ this . loading && this . genLoader ( )
155
+ ]
159
156
160
- tag === 'button' && ( data . attrs ! . type = this . type )
161
- this . loading && children . push ( this . genLoader ( ) )
157
+ if ( tag === 'button' ) data . attrs ! . type = this . type
162
158
163
159
data . attrs ! . value = [ 'string' , 'number' ] . includes ( typeof this . value )
164
160
? this . value
0 commit comments