2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2022-07-20 13:24:26 +00:00
|
|
|
<XModalWindow
|
|
|
|
ref="dialog"
|
2020-10-17 11:12:00 +00:00
|
|
|
:width="370"
|
|
|
|
:height="400"
|
2022-05-19 11:28:08 +00:00
|
|
|
@close="onClose"
|
2022-01-15 21:59:35 +00:00
|
|
|
@closed="emit('closed')"
|
2020-10-17 11:12:00 +00:00
|
|
|
>
|
2022-07-20 13:24:26 +00:00
|
|
|
<template #header>{{ i18n.ts.login }}</template>
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-05-19 11:28:08 +00:00
|
|
|
<MkSignin :auto-set="autoSet" :message="message" @login="onLogin"/>
|
2020-10-17 11:12:00 +00:00
|
|
|
</XModalWindow>
|
2020-01-29 19:37:25 +00:00
|
|
|
</template>
|
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-08-30 15:24:33 +00:00
|
|
|
import MkSignin from '@/components/MkSignin.vue';
|
2022-09-06 09:21:49 +00:00
|
|
|
import XModalWindow from '@/components/MkModalWindow.vue';
|
2022-07-20 13:24:26 +00:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
autoSet?: boolean;
|
2022-05-19 11:28:08 +00:00
|
|
|
message?: string,
|
2022-01-15 21:59:35 +00:00
|
|
|
}>(), {
|
|
|
|
autoSet: false,
|
2022-07-20 13:24:26 +00:00
|
|
|
message: '',
|
2022-01-15 21:59:35 +00:00
|
|
|
});
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
const emit = defineEmits<{
|
2022-05-19 11:28:08 +00:00
|
|
|
(ev: 'done'): void;
|
|
|
|
(ev: 'closed'): void;
|
|
|
|
(ev: 'cancelled'): void;
|
2022-01-15 21:59:35 +00:00
|
|
|
}>();
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
const dialog = $ref<InstanceType<typeof XModalWindow>>();
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-05-19 11:28:08 +00:00
|
|
|
function onClose() {
|
|
|
|
emit('cancelled');
|
|
|
|
dialog.close();
|
|
|
|
}
|
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
function onLogin(res) {
|
|
|
|
emit('done', res);
|
|
|
|
dialog.close();
|
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
</script>
|