diff --git a/examples/routers/input-number.vue b/examples/routers/input-number.vue
index d228c31f..e14e3d77 100644
--- a/examples/routers/input-number.vue
+++ b/examples/routers/input-number.vue
@@ -6,7 +6,7 @@
- {{ value1 }}
+
@@ -22,7 +22,8 @@
obj: {
},
- value1: 1.0
+ value1: 1.0,
+ value2: 1
};
},
computed: {},
diff --git a/package.json b/package.json
index 7280ac39..f95753b1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "iview",
- "version": "2.4.0-beta.2",
+ "version": "2.4.0-beta.3",
"title": "iView",
"description": "A high quality UI components Library with Vue.js",
"homepage": "http://www.iviewui.com",
diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue
index 0bc13216..4ebe764c 100644
--- a/src/components/input-number/input-number.vue
+++ b/src/components/input-number/input-number.vue
@@ -161,7 +161,7 @@
},
precisionValue () {
// can not display 1.0
- return this.currentValue.toFixed(this.precision);
+ return this.precision ? this.currentValue.toFixed(this.precision) : this.currentValue;
}
},
methods: {
@@ -219,7 +219,9 @@
this.setValue(val);
},
setValue (val) {
- val = Number(Number(val).toFixed(this.precision));
+ // 如果 step 是小数,且没有设置 precision,是有问题的
+ if (this.precision) val = Number(Number(val).toFixed(this.precision));
+
this.$nextTick(() => {
this.currentValue = val;
this.$emit('input', val);