Add the 'clearable' attribute to the input on the signin page. Add the 'type' attribute to the password input and add a button to show/hide the password.

This commit is contained in:
Rafi
2023-03-08 10:37:00 +08:00
parent 4f32ef69b2
commit f251b16afe

View File

@@ -22,6 +22,7 @@
:rules="formRules.username" :rules="formRules.username"
label="User name" label="User name"
variant="underlined" variant="underlined"
clearable
></v-text-field> ></v-text-field>
<v-text-field <v-text-field
v-model="formData.password" v-model="formData.password"
@@ -29,6 +30,10 @@
label="Password" label="Password"
variant="underlined" variant="underlined"
@keyup.enter="submit" @keyup.enter="submit"
clearable
:type="passwordInputType"
:append-inner-icon="passwordInputType === 'password' ? 'visibility' : 'visibility_off'"
@click:append-inner="passwordInputType = passwordInputType === 'password' ? 'text' : 'password'"
></v-text-field> ></v-text-field>
</v-form> </v-form>
@@ -83,6 +88,7 @@ const signInForm = ref(null)
const valid = ref(true) const valid = ref(true)
const submitting = ref(false) const submitting = ref(false)
const route = useRoute() const route = useRoute()
const passwordInputType = ref('password')
const submit = async () => { const submit = async () => {
errorMsg.value = null errorMsg.value = null