We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 185cd9b + 34e6292 commit bc75965Copy full SHA for bc75965
src/components/Login.vue
@@ -16,7 +16,7 @@
16
17
<div v-if="tokenRequired">
18
<div class="form-floating mt-3">
19
- <input id="otp" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
+ <input id="otp" ref="otpInput" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
20
<label for="otp">{{ $t("Token") }}</label>
21
</div>
22
@@ -55,6 +55,16 @@ export default {
55
};
56
},
57
58
+ watch: {
59
+ tokenRequired(newVal) {
60
+ if (newVal) {
61
+ this.$nextTick(() => {
62
+ this.$refs.otpInput?.focus();
63
+ });
64
+ }
65
66
+ },
67
+
68
mounted() {
69
document.title += " - Login";
70
0 commit comments