Эх сурвалжийг харах

InputNumber: fix accessing missing $refs in updated hook (#10995)

杨奕 7 жил өмнө
parent
commit
dd773b9e72

+ 2 - 1
packages/input-number/src/input-number.vue

@@ -216,7 +216,8 @@
       innerInput.setAttribute('aria-disabled', this.inputNumberDisabled);
     },
     updated() {
-      let innerInput = this.$refs.input.$refs.input;
+      if (!this.$refs || !this.$refs.input) return;
+      const innerInput = this.$refs.input.$refs.input;
       innerInput.setAttribute('aria-valuenow', this.currentValue);
     }
   };