2020-11-15 06:42:04 +02:00
|
|
|
<template>
|
|
|
|
<div class="voxdxuby">
|
2021-01-30 03:59:05 +02:00
|
|
|
<XNote v-if="note && !block.detailed" v-model:note="note" :key="note.id + ':normal'"/>
|
|
|
|
<XNoteDetailed v-if="note && block.detailed" v-model:note="note" :key="note.id + ':detail'"/>
|
2020-11-15 06:42:04 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2021-01-30 03:59:05 +02:00
|
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
2021-03-23 10:30:14 +02:00
|
|
|
import XNote from '@client/components/note.vue';
|
|
|
|
import XNoteDetailed from '@client/components/note-detailed.vue';
|
|
|
|
import * as os from '@client/os';
|
|
|
|
import { NoteBlock } from '@client/scripts/hpml/block';
|
2020-11-15 06:42:04 +02:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2021-01-15 16:18:14 +02:00
|
|
|
XNote,
|
|
|
|
XNoteDetailed,
|
2020-11-15 06:42:04 +02:00
|
|
|
},
|
|
|
|
props: {
|
2021-01-30 03:59:05 +02:00
|
|
|
block: {
|
|
|
|
type: Object as PropType<NoteBlock>,
|
2020-11-15 06:42:04 +02:00
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
2021-01-30 03:59:05 +02: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 06:42:04 +02:00
|
|
|
return {
|
2021-01-30 03:59:05 +02:00
|
|
|
note
|
2020-11-15 06:42:04 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.voxdxuby {
|
|
|
|
margin: 1em 0;
|
|
|
|
}
|
|
|
|
</style>
|