2020-11-15 04:42:04 +00:00
|
|
|
<template>
|
|
|
|
<div class="voxdxuby">
|
2021-11-19 10:36:12 +00:00
|
|
|
<XNote v-if="note && !block.detailed" :key="note.id + ':normal'" v-model:note="note"/>
|
|
|
|
<XNoteDetailed v-if="note && block.detailed" :key="note.id + ':detail'" v-model:note="note"/>
|
2020-11-15 04:42:04 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 01:59:05 +00:00
|
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
2022-08-30 15:24:33 +00:00
|
|
|
import XNote from '@/components/MkNote.vue';
|
|
|
|
import XNoteDetailed from '@/components/MkNoteDetailed.vue';
|
2021-11-11 17:02:25 +00:00
|
|
|
import * as os from '@/os';
|
|
|
|
import { NoteBlock } from '@/scripts/hpml/block';
|
2020-11-15 04:42:04 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2021-01-15 14:18:14 +00:00
|
|
|
XNote,
|
|
|
|
XNoteDetailed,
|
2020-11-15 04:42:04 +00:00
|
|
|
},
|
|
|
|
props: {
|
2021-01-30 01:59:05 +00:00
|
|
|
block: {
|
|
|
|
type: Object as PropType<NoteBlock>,
|
2022-12-22 07:01:59 +00:00
|
|
|
required: true,
|
|
|
|
},
|
2020-11-15 04:42:04 +00:00
|
|
|
},
|
2021-01-30 01:59:05 +00: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 09:01:06 +00:00
|
|
|
.then(result => {
|
|
|
|
note.value = result;
|
|
|
|
});
|
2021-01-30 01:59:05 +00:00
|
|
|
});
|
|
|
|
|
2020-11-15 04:42:04 +00:00
|
|
|
return {
|
2022-12-22 07:01:59 +00:00
|
|
|
note,
|
2020-11-15 04:42:04 +00:00
|
|
|
};
|
2022-12-22 07:01:59 +00:00
|
|
|
},
|
2020-11-15 04:42:04 +00:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
2022-12-27 09:01:06 +00:00
|
|
|
<style lang="scss">
|
2020-11-15 04:42:04 +00:00
|
|
|
.voxdxuby {
|
|
|
|
margin: 1em 0;
|
|
|
|
}
|
|
|
|
</style>
|