@@ -11,6 +11,7 @@ export default createComponent({
1111 integer : Boolean ,
1212 disabled : Boolean ,
1313 inputWidth : [ String , Number ] ,
14+ buttonSize : [ String , Number ] ,
1415 asyncChange : Boolean ,
1516 disableInput : Boolean ,
1617 min : {
@@ -49,6 +50,32 @@ export default createComponent({
4950
5051 plusDisabled ( ) {
5152 return this . disabled || this . currentValue >= this . max ;
53+ } ,
54+
55+ inputStyle ( ) {
56+ const style = { } ;
57+
58+ if ( this . inputWidth ) {
59+ style . width = suffixPx ( this . inputWidth ) ;
60+ }
61+
62+ if ( this . buttonSize ) {
63+ style . height = suffixPx ( this . buttonSize ) ;
64+ }
65+
66+ return style ;
67+ } ,
68+
69+ buttonStyle ( ) {
70+ const style = { } ;
71+
72+ if ( this . buttonSize ) {
73+ const size = suffixPx ( this . buttonSize ) ;
74+ style . width = size ;
75+ style . height = size ;
76+ }
77+
78+ return style ;
5279 }
5380 } ,
5481
@@ -174,6 +201,7 @@ export default createComponent({
174201 return (
175202 < div class = { bem ( ) } >
176203 < button
204+ style = { this . buttonStyle }
177205 class = { bem ( 'minus' , { disabled : this . minusDisabled } ) }
178206 { ...createListeners ( 'minus' ) }
179207 />
@@ -186,12 +214,13 @@ export default createComponent({
186214 aria-valuemin = { this . min }
187215 aria-valuenow = { this . currentValue }
188216 disabled = { this . disabled || this . disableInput }
189- style = { { width : suffixPx ( this . inputWidth ) } }
217+ style = { this . inputStyle }
190218 onInput = { this . onInput }
191219 onFocus = { this . onFocus }
192220 onBlur = { this . onBlur }
193221 />
194222 < button
223+ style = { this . buttonStyle }
195224 class = { bem ( 'plus' , { disabled : this . plusDisabled } ) }
196225 { ...createListeners ( 'plus' ) }
197226 />
0 commit comments