From 8df29435feea52474e1246707d84b68b9f82c2e2 Mon Sep 17 00:00:00 2001 From: Rijn Date: Mon, 20 Feb 2017 09:33:48 -0600 Subject: [PATCH] changed regular expression to fit exactly one zero --- src/components/input-number/input-number.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index 48316d3..1534317 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -34,7 +34,7 @@ const iconPrefixCls = 'ivu-icon'; function isValueNumber (value) { - return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)/).test(value + ''); + return (/(^-?[0-9]+\.{1}\d+$)|(^-?[1-9][0-9]*$)|(^-?0{1}$)/).test(value + ''); } function addNum (num1, num2) { let sq1, sq2, m; -- libgit2 0.21.4