2020-01-29 19:37:25 +00:00
|
|
|
<template>
|
2023-01-06 00:41:14 +00:00
|
|
|
<MkModalWindow
|
2022-07-20 13:24:26 +00:00
|
|
|
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
|
|
|
|
2023-01-06 00:41:14 +00:00
|
|
|
<MkSpacer :margin-min="20" :margin-max="28">
|
|
|
|
<MkSignin :auto-set="autoSet" :message="message" @login="onLogin"/>
|
|
|
|
</MkSpacer>
|
|
|
|
</MkModalWindow>
|
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';
|
2023-01-06 00:41:14 +00:00
|
|
|
import MkModalWindow from '@/components/MkModalWindow.vue';
|
2022-07-20 13:24:26 +00:00
|
|
|
import { i18n } from '@/i18n';
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-03-09 05:27:16 +00:00
|
|
|
withDefaults(defineProps<{
|
2022-01-15 21:59:35 +00:00
|
|
|
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<{
|
2023-03-09 05:27:16 +00:00
|
|
|
(ev: 'done', v: any): void;
|
2022-05-19 11:28:08 +00:00
|
|
|
(ev: 'closed'): void;
|
|
|
|
(ev: 'cancelled'): void;
|
2022-01-15 21:59:35 +00:00
|
|
|
}>();
|
2020-01-29 19:37:25 +00:00
|
|
|
|
2023-01-06 00:41:14 +00:00
|
|
|
const dialog = $shallowRef<InstanceType<typeof MkModalWindow>>();
|
2020-10-17 11:12:00 +00:00
|
|
|
|
2022-05-19 11:28:08 +00:00
|
|
|
function onClose() {
|
|
|
|
emit('cancelled');
|
2023-03-09 05:27:16 +00:00
|
|
|
if (dialog) dialog.close();
|
2022-05-19 11:28:08 +00:00
|
|
|
}
|
|
|
|
|
2022-01-15 21:59:35 +00:00
|
|
|
function onLogin(res) {
|
|
|
|
emit('done', res);
|
2023-03-09 05:27:16 +00:00
|
|
|
if (dialog) dialog.close();
|
2022-01-15 21:59:35 +00:00
|
|
|
}
|
2020-01-29 19:37:25 +00:00
|
|
|
</script>
|