[new feature] NumberKeyboard: add maxlength prop (#3532)

This commit is contained in:
neverland
2019-06-17 15:33:25 +08:00
committed by GitHub
parent ce3dfc859a
commit 8331b7597d
6 changed files with 34 additions and 4 deletions

View File

@@ -38,6 +38,10 @@ export default sfc({
type: String,
default: ''
},
maxlength: {
type: [Number, String],
default: Number.MAX_VALUE
},
zIndex: {
type: Number,
default: 100
@@ -118,7 +122,7 @@ export default sfc({
this.$emit('update:value', value.slice(0, value.length - 1));
} else if (type === 'close') {
this.onClose();
} else {
} else if (value.length < this.maxlength) {
this.$emit('input', text);
this.$emit('update:value', value + text);
}