mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-11 03:53:09 +02:00
100a131913
* pages refactoring * pages: fix if block * fix code format * remove passing of the page parameter * remove comment * fix indent * replace with unref * fix conditions of isVarBlock() * Update src/client/scripts/hpml/block.ts use includes() instead of find() Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
47 lines
996 B
Vue
47 lines
996 B
Vue
<template>
|
|
<div class="voxdxuby">
|
|
<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'"/>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, onMounted, PropType, Ref, ref } from 'vue';
|
|
import XNote from '@/components/note.vue';
|
|
import XNoteDetailed from '@/components/note-detailed.vue';
|
|
import * as os from '@/os';
|
|
import { NoteBlock } from '@/scripts/hpml/block';
|
|
|
|
export default defineComponent({
|
|
components: {
|
|
XNote,
|
|
XNoteDetailed,
|
|
},
|
|
props: {
|
|
block: {
|
|
type: Object as PropType<NoteBlock>,
|
|
required: true
|
|
}
|
|
},
|
|
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;
|
|
});
|
|
});
|
|
|
|
return {
|
|
note
|
|
};
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.voxdxuby {
|
|
margin: 1em 0;
|
|
}
|
|
</style>
|