1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-23 19:18:44 +09:00
MisskeyIO/packages/frontend/src/components/page/page.note.vue

48 lines
1009 B
Vue
Raw Normal View History

2020-11-15 13:42:04 +09:00
<template>
<div class="voxdxuby">
2023-03-31 14:14:30 +09:00
<MkNote v-if="note && !block.detailed" :key="note.id + ':normal'" v-model:note="note"/>
<MkNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" v-model:note="note"/>
2020-11-15 13:42:04 +09:00
</div>
</template>
<script lang="ts">
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
2023-03-31 14:14:30 +09:00
import MkNote from '@/components/MkNote.vue';
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
2021-11-12 02:02:25 +09:00
import * as os from '@/os';
import { NoteBlock } from '@/scripts/hpml/block';
2020-11-15 13:42:04 +09:00
export default defineComponent({
components: {
2023-03-31 14:14:30 +09:00
MkNote,
MkNoteDetailed,
2020-11-15 13:42:04 +09:00
},
props: {
block: {
type: Object as PropType<NoteBlock>,
required: true,
},
2020-11-15 13:42:04 +09:00
},
setup(props, ctx) {
const note: Ref<Record<string, any> | null> = ref(null);
onMounted(() => {
os.api('notes/show', { noteId: props.block.note })
.then(result => {
note.value = result;
});
});
2020-11-15 13:42:04 +09:00
return {
note,
2020-11-15 13:42:04 +09:00
};
},
2020-11-15 13:42:04 +09:00
});
</script>
<style lang="scss" scoped>
2020-11-15 13:42:04 +09:00
.voxdxuby {
margin: 1em 0;
}
</style>