wip: refactor(client): migrate components to composition api

This commit is contained in:
syuilo
2022-01-16 06:59:35 +09:00
parent c17e8fa8a4
commit 9693dfb09d
4 changed files with 88 additions and 132 deletions

View File

@@ -2,8 +2,8 @@
<XModalWindow ref="dialog"
:width="370"
:height="400"
@close="$refs.dialog.close()"
@closed="$emit('closed')"
@close="dialog.close()"
@closed="emit('closed')"
>
<template #header>{{ $ts.login }}</template>
@@ -11,32 +11,26 @@
</XModalWindow>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
<script lang="ts" setup>
import { } from 'vue';
import XModalWindow from '@/components/ui/modal-window.vue';
import MkSignin from './signin.vue';
export default defineComponent({
components: {
MkSignin,
XModalWindow,
},
props: {
autoSet: {
type: Boolean,
required: false,
default: false,
}
},
emits: ['done', 'closed'],
methods: {
onLogin(res) {
this.$emit('done', res);
this.$refs.dialog.close();
}
}
const props = withDefaults(defineProps<{
autoSet?: boolean;
}>(), {
autoSet: false,
});
const emit = defineEmits<{
(e: 'done'): void;
(e: 'closed'): void;
}>();
const dialog = $ref<InstanceType<typeof XModalWindow>>();
function onLogin(res) {
emit('done', res);
dialog.close();
}
</script>