2020-11-15 05:42:04 +01:00
|
|
|
<template>
|
|
|
|
<div class="voxdxuby">
|
2023-03-31 07:14:30 +02: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 05:42:04 +01:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 02:59:05 +01:00
|
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
2023-03-31 07:14:30 +02:00
|
|
|
import MkNote from '@/components/MkNote.vue';
|
|
|
|
import MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
2021-11-11 18:02:25 +01:00
|
|
|
import * as os from '@/os';
|
|
|
|
import { NoteBlock } from '@/scripts/hpml/block';
|
2020-11-15 05:42:04 +01:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2023-03-31 07:14:30 +02:00
|
|
|
MkNote,
|
|
|
|
MkNoteDetailed,
|
2020-11-15 05:42:04 +01:00
|
|
|
},
|
|
|
|
props: {
|
2021-01-30 02:59:05 +01:00
|
|
|
block: {
|
|
|
|
type: Object as PropType<NoteBlock>,
|
2022-12-22 08:01:59 +01:00
|
|
|
required: true,
|
|
|
|
},
|
2020-11-15 05:42:04 +01:00
|
|
|
},
|
2021-01-30 02:59:05 +01:00
|
|
|
setup(props, ctx) {
|
|
|
|
const note: Ref<Record<string, any> | null> = ref(null);
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
os.api('notes/show', { noteId: props.block.note })
|
2022-12-27 10:29:39 +01:00
|
|
|
.then(result => {
|
|
|
|
note.value = result;
|
|
|
|
});
|
2021-01-30 02:59:05 +01:00
|
|
|
});
|
|
|
|
|
2020-11-15 05:42:04 +01:00
|
|
|
return {
|
2022-12-22 08:01:59 +01:00
|
|
|
note,
|
2020-11-15 05:42:04 +01:00
|
|
|
};
|
2022-12-22 08:01:59 +01:00
|
|
|
},
|
2020-11-15 05:42:04 +01:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-12-27 10:29:39 +01:00
|
|
|
<style lang="scss" scoped>
|
2020-11-15 05:42:04 +01:00
|
|
|
.voxdxuby {
|
|
|
|
margin: 1em 0;
|
|
|
|
}
|
|
|
|
</style>
|