Browse Source
perf: reset value after reopen LockScreenModal (#4269)
* perf: replace deprecated @keypress with @keydown for Enter key handling
* perf: reset value after reopen LockScreenModal
pull/4271/head
handsomeFu
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
14 additions and
7 deletions
-
packages/effects/layouts/src/widgets/lock-screen/lock-screen-modal.vue
-
packages/effects/layouts/src/widgets/lock-screen/lock-screen.vue
|
|
|
@ -34,15 +34,22 @@ const emit = defineEmits<{ |
|
|
|
submit: RegisterEmits['submit']; |
|
|
|
}>(); |
|
|
|
|
|
|
|
const formState = reactive({ |
|
|
|
lockScreenPassword: '', |
|
|
|
submitted: false, |
|
|
|
}); |
|
|
|
|
|
|
|
const [Modal] = useVbenModal({ |
|
|
|
onConfirm() { |
|
|
|
handleSubmit(); |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
const formState = reactive({ |
|
|
|
lockScreenPassword: '', |
|
|
|
submitted: false, |
|
|
|
onOpenChange(isOpen) { |
|
|
|
if (isOpen) { |
|
|
|
// reset value reopen |
|
|
|
formState.submitted = false; |
|
|
|
formState.lockScreenPassword = ''; |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
const passwordStatus = computed(() => { |
|
|
|
@ -70,7 +77,7 @@ function handleSubmit() { |
|
|
|
> |
|
|
|
<div |
|
|
|
class="mb-10 flex w-full flex-col items-center px-10" |
|
|
|
@keypress.enter.prevent="handleSubmit" |
|
|
|
@keydown.enter.prevent="handleSubmit" |
|
|
|
> |
|
|
|
<div class="w-full"> |
|
|
|
<div class="ml-2 flex w-full flex-col items-center"> |
|
|
|
|
|
|
|
@ -120,7 +120,7 @@ function toggleUnlockForm() { |
|
|
|
<div |
|
|
|
v-if="showUnlockForm" |
|
|
|
class="flex-center size-full" |
|
|
|
@keypress.enter.prevent="handleSubmit" |
|
|
|
@keydown.enter.prevent="handleSubmit" |
|
|
|
> |
|
|
|
<div class="flex-col-center mb-10 w-[300px]"> |
|
|
|
<VbenAvatar :src="avatar" class="enter-x mb-6 size-20" /> |
|
|
|
|