refactor: post-form-dialog.vue to composition api

This commit is contained in:
Norm 2022-08-20 00:58:17 -04:00
parent e8414e8c8d
commit ffc23ae458
Signed by untrusted user: norm
GPG key ID: 7123E30E441E80DE

View file

@ -1,19 +1,16 @@
<template>
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="$refs.modal.close()" @closed="$emit('closed')">
<MkPostForm v-bind="$attrs" @posted="$refs.modal.close()" @cancel="$refs.modal.close()" @esc="$refs.modal.close()"/>
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="modal.close()" @closed="emit('closed')">
<MkPostForm v-bind="$attrs" @posted="modal.close()" @cancel="modal.close()" @esc="modal.close()"/>
</MkModal>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
<script lang="ts" setup>
import MkModal from '@/components/ui/modal.vue';
import MkPostForm from '@/components/post-form.vue';
export default defineComponent({
components: {
MkModal,
MkPostForm,
},
emits: ['closed'],
});
const emit = defineEmits<{
(ev: 'closed'): void;
}>();
let modal: InstanceType<typeof MkModal> = $ref();
</script>