Merge pull request #557 from bottotl/main [skip ci]

feat: 改善登录表单的可访问性和自动填充支持
This commit is contained in:
Wesley Liddick
2025-10-13 11:36:42 +08:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -39,12 +39,17 @@
<form class="space-y-4 sm:space-y-6" @submit.prevent="handleLogin">
<div>
<label class="mb-2 block text-sm font-semibold text-gray-900 dark:text-gray-100 sm:mb-3"
<label
class="mb-2 block text-sm font-semibold text-gray-900 dark:text-gray-100 sm:mb-3"
for="username"
>用户名</label
>
<input
id="username"
v-model="loginForm.username"
autocomplete="username"
class="form-input w-full"
name="username"
placeholder="请输入用户名"
required
type="text"
@@ -52,12 +57,17 @@
</div>
<div>
<label class="mb-2 block text-sm font-semibold text-gray-900 dark:text-gray-100 sm:mb-3"
<label
class="mb-2 block text-sm font-semibold text-gray-900 dark:text-gray-100 sm:mb-3"
for="password"
>密码</label
>
<input
id="password"
v-model="loginForm.password"
autocomplete="current-password"
class="form-input w-full"
name="password"
placeholder="请输入密码"
required
type="password"

View File

@@ -46,6 +46,7 @@
<input
id="username"
v-model="form.username"
autocomplete="username"
class="relative block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-blue-500 focus:outline-none focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-400 dark:focus:ring-blue-400 sm:text-sm"
:disabled="loading"
name="username"
@@ -67,6 +68,7 @@
<input
id="password"
v-model="form.password"
autocomplete="current-password"
class="relative block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 text-gray-900 placeholder-gray-500 focus:z-10 focus:border-blue-500 focus:outline-none focus:ring-blue-500 dark:border-gray-600 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400 dark:focus:border-blue-400 dark:focus:ring-blue-400 sm:text-sm"
:disabled="loading"
name="password"