Skip to content

Commit bc75965

Browse files
authored
Merge branch 'master' into master
2 parents 185cd9b + 34e6292 commit bc75965

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/Login.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<div v-if="tokenRequired">
1818
<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>
19+
<input id="otp" ref="otpInput" v-model="token" type="text" maxlength="6" class="form-control" placeholder="123456" autocomplete="one-time-code" required>
2020
<label for="otp">{{ $t("Token") }}</label>
2121
</div>
2222
</div>
@@ -55,6 +55,16 @@ export default {
5555
};
5656
},
5757
58+
watch: {
59+
tokenRequired(newVal) {
60+
if (newVal) {
61+
this.$nextTick(() => {
62+
this.$refs.otpInput?.focus();
63+
});
64+
}
65+
}
66+
},
67+
5868
mounted() {
5969
document.title += " - Login";
6070
},

0 commit comments

Comments
 (0)