auto focus pin code input when open desktop unlock page

This commit is contained in:
MaysWind
2023-07-02 23:38:15 +08:00
parent 748cf68055
commit 7cf53acd18
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -7,6 +7,7 @@
:ref="`pin-code-input-${index}`"
:value="codes[index].value"
:type="codes[index].inputType"
:autofocus="autofocus && index === 0 ? 'autofocus' : undefined"
@focus="codes[index].focused = true"
@blur="codes[index].focused = false"
@keydown="onKeydown(index, $event)"
@@ -21,6 +22,7 @@
export default {
props: [
'modelValue',
'autofocus',
'secure',
'length'
],
+2 -1
View File
@@ -19,7 +19,8 @@
<v-form>
<v-row>
<v-col cols="12">
<pin-code-input :secure="true" :length="6" v-model="pinCode" @pincode:confirm="unlockByPin" />
<pin-code-input :autofocus="true" :secure="true" :length="6"
v-model="pinCode" @pincode:confirm="unlockByPin" />
</v-col>
<v-col cols="12">