From 5b36b9c43e0e1464752fcbb93b1396c48b930491 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Sun, 23 May 2021 20:21:17 +0800 Subject: [PATCH] fix(input-number): don't use `this.inputRef` when the component is already unmounted (#4103) --- components/vc-input-number/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/vc-input-number/src/index.js b/components/vc-input-number/src/index.js index 409c241b9..d449f54a3 100755 --- a/components/vc-input-number/src/index.js +++ b/components/vc-input-number/src/index.js @@ -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;