[bugfix] Stepper: should filter invalid input (#1599)

This commit is contained in:
neverland 2019-05-05 19:57:11 +08:00 committed by GitHub
parent 71962b2fb1
commit 02ac38fa60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,6 +77,7 @@ VantComponent({
// limit value range // limit value range
range(value) { range(value) {
value = String(value).replace(/[^0-9.-]/g, '');
return Math.max(Math.min(this.data.max, value), this.data.min); return Math.max(Math.min(this.data.max, value), this.data.min);
}, },