Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input: not trigger form validation when input #12260

Merged
merged 2 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/docs/en-US/input-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Allows you to define incremental steps.
:::

:::tip
The value of `precision` must be a positive integer and should not be less than the decimal places of `step`.
The value of `precision` must be a non negative integer and should not be less than the decimal places of `step`.
:::

### Size
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/es/input-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Le permite definir el nivel de incremento de los saltos.
:::

:::tip
The value of `precision` must be a positive integer and should not be less than the decimal places of `step`.
The value of `precision` must be a non negative integer and should not be less than the decimal places of `step`.
:::

### Tamaño
Expand Down
2 changes: 1 addition & 1 deletion examples/docs/zh-CN/input-number.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
:::

:::tip
`precision` 的值必须是一个正整数,并且不能小于 `step` 的小数位数。
`precision` 的值必须是一个非负整数,并且不能小于 `step` 的小数位数。
:::

### 尺寸
Expand Down
19 changes: 8 additions & 11 deletions packages/form/src/form-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,16 @@
}
return parent;
},
fieldValue: {
cache: false,
get() {
const model = this.form.model;
if (!model || !this.prop) { return; }
fieldValue() {
const model = this.form.model;
if (!model || !this.prop) { return; }

let path = this.prop;
if (path.indexOf(':') !== -1) {
path = path.replace(/:/, '.');
}

return getPropByPath(model, path, true).v;
let path = this.prop;
if (path.indexOf(':') !== -1) {
path = path.replace(/:/, '.');
}

return getPropByPath(model, path, true).v;
},
isRequired() {
let rules = this.getRules();
Expand Down
8 changes: 3 additions & 5 deletions packages/input/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
},

watch: {
'value'(val, oldValue) {
value(val, oldValue) {
this.setCurrentValue(val);
}
},
Expand Down Expand Up @@ -283,10 +283,8 @@
if (this.isOnComposition && value === this.valueBeforeComposition) return;
this.currentValue = value;
if (this.isOnComposition) return;
this.$nextTick(_ => {
this.resizeTextarea();
});
if (this.validateEvent) {
this.$nextTick(this.resizeTextarea);
if (this.validateEvent && this.currentValue === this.value) {
this.dispatch('ElFormItem', 'el.form.change', [value]);
}
},
Expand Down