feat(Stepper): add disable-plus & disable-minus props (#5180)

This commit is contained in:
Jake
2019-12-03 18:53:47 +08:00
committed by neverland
parent 34a817612d
commit c691accb33
4 changed files with 41 additions and 2 deletions
+8 -2
View File
@@ -54,6 +54,12 @@ export default createComponent({
showMinus: {
type: Boolean,
default: true
},
disablePlus: {
type: Boolean
},
disableMinus: {
type: Boolean
}
},
@@ -72,11 +78,11 @@ export default createComponent({
computed: {
minusDisabled() {
return this.disabled || this.currentValue <= this.min;
return this.disabled || this.disableMinus || this.currentValue <= this.min;
},
plusDisabled() {
return this.disabled || this.currentValue >= this.max;
return this.disabled || this.disablePlus || this.currentValue >= this.max;
},
inputStyle() {