fix(input-number): don't use `this.inputRef` when the component is already unmounted (#4103)

pull/4111/head
Carter Li 2021-05-23 20:21:17 +08:00 committed by GitHub
parent 7109a063c6
commit 5b36b9c43e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -292,7 +292,7 @@ export default defineComponent({
});
const value = this.getCurrentValidValue(this.$data.inputValue);
const newValue = this.setValue(value);
if (this.$attrs.onBlur) {
if (this.$attrs.onBlur && this.inputRef) {
const originValue = this.inputRef.value;
const inputValue = this.getInputDisplayValue({ focused: false, sValue: newValue });
this.inputRef.value = inputValue;