diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index aaaf123..eda0df3 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -29,6 +29,7 @@
-import { defineComponent } from "vue";
+import { defineComponent, ref, onMounted, nextTick } from "vue";
import Layout from "~/components/Layout.vue";
import ErrorBox from "~/components/ErrorBox.vue";
import type { KcContextBase } from "~/types/context";
@@ -96,6 +97,19 @@ export default defineComponent({
context: (window as any).kcContext as KcContextBase.Login,
};
},
+ setup() {
+ const focus = ref(null);
+
+ onMounted(() => {
+ nextTick(() => {
+ focus.value.focus();
+ });
+ });
+
+ return {
+ focus,
+ };
+ },
});