Forráskód Böngészése

forward QInput's methods

Falko Schindler 1 éve
szülő
commit
ba506ed047
1 módosított fájl, 16 hozzáadás és 0 törlés
  1. 16 0
      nicegui/elements/input.js

+ 16 - 0
nicegui/elements/input.js

@@ -1,6 +1,7 @@
 export default {
   template: `
     <q-input
+      ref="inputRef"
       v-bind="$attrs"
       v-model="inputValue"
       :shadow-text="shadowText"
@@ -60,5 +61,20 @@ export default {
         e.preventDefault();
       }
     },
+    resetValidation() {
+      this.$refs.inputRef.resetValidation();
+    },
+    validate(value) {
+      return this.$refs.inputRef.validate(value);
+    },
+    focus() {
+      this.$refs.inputRef.focus();
+    },
+    blur() {
+      this.$refs.inputRef.blur();
+    },
+    select() {
+      this.$refs.inputRef.select();
+    },
   },
 };