diff options
Diffstat (limited to 'viewer/src/components/LdInformation.vue')
-rw-r--r-- | viewer/src/components/LdInformation.vue | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/viewer/src/components/LdInformation.vue b/viewer/src/components/LdInformation.vue index 66ccc80..68e1817 100644 --- a/viewer/src/components/LdInformation.vue +++ b/viewer/src/components/LdInformation.vue | |||
@@ -21,28 +21,28 @@ | |||
21 | <div v-if="item" class="flex-column" :class="$style.infopanel"> | 21 | <div v-if="item" class="flex-column" :class="$style.infopanel"> |
22 | <div v-if="item.title" :class="$style.title">{{ item.title }}</div> | 22 | <div v-if="item.title" :class="$style.title">{{ item.title }}</div> |
23 | <time v-if="item.datetime" :datetime="item.datetime" :class="$style.datetime">{{ formatDate }}</time> | 23 | <time v-if="item.datetime" :datetime="item.datetime" :class="$style.datetime">{{ formatDate }}</time> |
24 | <div v-if="item.description" :class="$style.description" v-html="formatDescription" /> | 24 | <Markdown v-if="item.description" :class="$style.description" :markdown="item.description" /> |
25 | </div> | 25 | </div> |
26 | </template> | 26 | </template> |
27 | 27 | ||
28 | <script lang="ts"> | 28 | <script lang="ts"> |
29 | import { Component, Vue, Prop } from "vue-property-decorator"; | 29 | import { Item } from "@/@types/gallery"; |
30 | import marked from "marked"; | 30 | import { Markdown } from "@/components/async"; |
31 | import { Component, Prop, Vue } from "vue-property-decorator"; | ||
31 | 32 | ||
32 | @Component | 33 | @Component({ |
34 | components: { | ||
35 | Markdown, | ||
36 | }, | ||
37 | }) | ||
33 | export default class LdInformation extends Vue { | 38 | export default class LdInformation extends Vue { |
34 | @Prop({ required: true }) readonly item!: Gallery.Item; | 39 | @Prop({ required: true }) readonly item!: Item; |
35 | 40 | ||
36 | get formatDate() { | 41 | get formatDate() { |
37 | const date = this.item.datetime.substr(0, 10); | 42 | const date = this.item.datetime.substr(0, 10); |
38 | const time = this.item.datetime.substr(11, 5); | 43 | const time = this.item.datetime.substr(11, 5); |
39 | return `${date} ${time}`; | 44 | return `${date} ${time}`; |
40 | } | 45 | } |
41 | |||
42 | get formatDescription() { | ||
43 | if (!this.item.description) return ""; | ||
44 | return marked(this.item.description); | ||
45 | } | ||
46 | } | 46 | } |
47 | </script> | 47 | </script> |
48 | 48 | ||