pin code input supports pressing enter to confirm and pressing tab to switch to the next component

This commit is contained in:
MaysWind
2025-01-04 16:33:33 +08:00
parent af9aa726f4
commit d18e6df1c0
5 changed files with 21 additions and 5 deletions
+1 -1
View File
@@ -32,7 +32,7 @@
<v-row>
<v-col cols="12">
<pin-code-input :disabled="verifyingByWebAuthn" :autofocus="true"
:secure="true" :length="6"
:secure="true" :length="6" :auto-confirm="true"
v-model="pinCode" @pincode:confirm="unlockByPin" />
</v-col>
@@ -33,7 +33,7 @@
<v-row class="mb-3">
<v-col cols="12" md="12">
<div style="max-width: 428px">
<pin-code-input :secure="true" :length="6" v-model="pinCode" />
<pin-code-input :secure="true" :length="6" v-model="pinCode" @pincode:confirm="confirm" />
</div>
</v-col>
</v-row>
@@ -147,6 +147,13 @@ export default {
});
},
methods: {
confirm() {
if (this.isEnableApplicationLock) {
this.disable();
} else {
this.enable();
}
},
enable() {
if (this.settingsStore.appSettings.applicationLock) {
this.$refs.snackbar.showMessage('Application lock has been enabled');
+1 -1
View File
@@ -12,7 +12,7 @@
</template>
</f7-list-item>
<f7-list-item class="list-item-pincode-input padding-horizontal margin-horizontal">
<pin-code-input :secure="true" :length="6" v-model="pinCode" @pincode:confirm="unlockByPin" />
<pin-code-input :secure="true" :length="6" :auto-confirm="true" v-model="pinCode" @pincode:confirm="unlockByPin" />
</f7-list-item>
</f7-list>