Pages埋め込みノートで詳細表示にするかどうか選べるように

This commit is contained in:
syuilo 2020-11-15 13:47:15 +09:00
parent f68df5e186
commit eb448dee8f
3 changed files with 7 additions and 3 deletions

View File

@ -1181,6 +1181,7 @@ _pages:
_note:
id: "ートID"
idDescription: "ートURLをペーストして設定することもできます。"
detailed: "詳細な表示"
switch: "スイッチ"
_switch:

View File

@ -1,6 +1,6 @@
<template>
<div class="voxdxuby">
<XNote v-if="note" v-model:note="note" :key="note.id"/>
<XNote v-if="note" v-model:note="note" :key="note.id" :detail="value.detailed"/>
</div>
</template>

View File

@ -7,8 +7,9 @@
<span>{{ $t('_pages.blocks._note.id') }}</span>
<template #desc>{{ $t('_pages.blocks._note.idDescription') }}</template>
</MkInput>
<MkSwitch v-model:value="value.detailed"><span>{{ $t('_pages.blocks._note.detailed') }}</span></MkSwitch>
<XNote v-if="note" v-model:note="note" :key="note.id" style="margin-bottom: 16px;"/>
<XNote v-if="note" v-model:note="note" :key="note.id + ':' + (value.detailed ? 'detailed' : 'normal')" :detail="value.detailed" style="margin-bottom: 16px;"/>
</section>
</XContainer>
</template>
@ -18,12 +19,13 @@ import { defineComponent } from 'vue';
import { faStickyNote } from '@fortawesome/free-solid-svg-icons';
import XContainer from '../page-editor.container.vue';
import MkInput from '@/components/ui/input.vue';
import MkSwitch from '@/components/ui/switch.vue';
import XNote from '@/components/note.vue';
import * as os from '@/os';
export default defineComponent({
components: {
XContainer, MkInput, XNote
XContainer, MkInput, MkSwitch, XNote
},
props: {
@ -57,6 +59,7 @@ export default defineComponent({
created() {
if (this.value.note == null) this.value.note = null;
if (this.value.detailed == null) this.value.detailed = false;
},
});
</script>