forked from FoundKeyGang/FoundKey
refactor: post-form-dialog.vue to composition api
This commit is contained in:
parent
e8414e8c8d
commit
ffc23ae458
1 changed files with 8 additions and 11 deletions
|
@ -1,19 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="$refs.modal.close()" @closed="$emit('closed')">
|
<MkModal ref="modal" :prefer-type="'dialog:top'" @click="modal.close()" @closed="emit('closed')">
|
||||||
<MkPostForm v-bind="$attrs" @posted="$refs.modal.close()" @cancel="$refs.modal.close()" @esc="$refs.modal.close()"/>
|
<MkPostForm v-bind="$attrs" @posted="modal.close()" @cancel="modal.close()" @esc="modal.close()"/>
|
||||||
</MkModal>
|
</MkModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import { defineComponent } from 'vue';
|
|
||||||
import MkModal from '@/components/ui/modal.vue';
|
import MkModal from '@/components/ui/modal.vue';
|
||||||
import MkPostForm from '@/components/post-form.vue';
|
import MkPostForm from '@/components/post-form.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
const emit = defineEmits<{
|
||||||
components: {
|
(ev: 'closed'): void;
|
||||||
MkModal,
|
}>();
|
||||||
MkPostForm,
|
|
||||||
},
|
let modal: InstanceType<typeof MkModal> = $ref();
|
||||||
emits: ['closed'],
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue