[new feature] Stepper: support number type of input-width prop

This commit is contained in:
陈嘉涵
2019-05-31 17:37:13 +08:00
parent 4d71231436
commit d8803abf9f
4 changed files with 12 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { use, isDef } from '../utils';
import { use, isDef, suffixPx } from '../utils';
const [sfc, bem] = use('stepper');
@@ -7,7 +7,7 @@ export default sfc({
value: null,
integer: Boolean,
disabled: Boolean,
inputWidth: String,
inputWidth: [String, Number],
asyncChange: Boolean,
disableInput: Boolean,
min: {
@@ -143,7 +143,7 @@ export default sfc({
aria-valuemin={this.min}
aria-valuenow={this.currentValue}
disabled={this.disabled || this.disableInput}
style={{ width: this.inputWidth }}
style={{ width: suffixPx(this.inputWidth) }}
onInput={this.onInput}
onFocus={this.onFocus}
onBlur={this.onBlur}