mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-25 17:53:48 +02:00
refactor: dialogs (#1216)
This commit is contained in:
59
src/views/Settings/dialogs/PrimaryPasswordDialog.vue
Normal file
59
src/views/Settings/dialogs/PrimaryPasswordDialog.vue
Normal file
@@ -0,0 +1,59 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="x-dialog"
|
||||
:visible.sync="enablePrimaryPasswordDialog.visible"
|
||||
:before-close="enablePrimaryPasswordDialog.beforeClose"
|
||||
:close-on-click-modal="false"
|
||||
:title="t('dialog.primary_password.header')"
|
||||
width="400px">
|
||||
<el-input
|
||||
v-model="enablePrimaryPasswordDialog.password"
|
||||
:placeholder="t('dialog.primary_password.password_placeholder')"
|
||||
type="password"
|
||||
size="mini"
|
||||
maxlength="32"
|
||||
show-password
|
||||
autofocus>
|
||||
</el-input>
|
||||
<el-input
|
||||
v-model="enablePrimaryPasswordDialog.rePassword"
|
||||
:placeholder="t('dialog.primary_password.re_input_placeholder')"
|
||||
type="password"
|
||||
style="margin-top: 5px"
|
||||
size="mini"
|
||||
maxlength="32"
|
||||
show-password>
|
||||
</el-input>
|
||||
<template #footer>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:disabled="
|
||||
enablePrimaryPasswordDialog.password.length === 0 ||
|
||||
enablePrimaryPasswordDialog.password !== enablePrimaryPasswordDialog.rePassword
|
||||
"
|
||||
@click="setPrimaryPassword">
|
||||
{{ t('dialog.primary_password.ok') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { useI18n } from 'vue-i18n-bridge';
|
||||
const { t } = useI18n();
|
||||
|
||||
const props = defineProps({
|
||||
enablePrimaryPasswordDialog: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
||||
const emit = defineEmits(['setPrimaryPassword']);
|
||||
|
||||
function setPrimaryPassword() {
|
||||
emit('setPrimaryPassword', props.enablePrimaryPasswordDialog.password);
|
||||
props.enablePrimaryPasswordDialog.visible = false;
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user