aboutsummaryrefslogtreecommitdiff
path: root/viewer/src/components/LdInformation.vue
diff options
context:
space:
mode:
authorZero~Informatique2021-07-03 23:07:09 +0200
committerpacien2021-07-04 17:07:52 +0200
commit9328223589fac14327223eb38c988cb32b781cbd (patch)
treeaa7af62416126dcf4eff1ba7ac6784b1c65bf22c /viewer/src/components/LdInformation.vue
parent7714815396b4e86afc5db1af3726fab4edf0ca35 (diff)
downloadldgallery-9328223589fac14327223eb38c988cb32b781cbd.tar.gz
viewer/LdInformation: use markdown rendering component
Extracted from b170f49 (GH PR #304)
Diffstat (limited to 'viewer/src/components/LdInformation.vue')
-rw-r--r--viewer/src/components/LdInformation.vue15
1 files changed, 7 insertions, 8 deletions
diff --git a/viewer/src/components/LdInformation.vue b/viewer/src/components/LdInformation.vue
index b161485..68e1817 100644
--- a/viewer/src/components/LdInformation.vue
+++ b/viewer/src/components/LdInformation.vue
@@ -21,16 +21,20 @@
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">
29import { Item } from "@/@types/gallery"; 29import { Item } from "@/@types/gallery";
30import marked from "marked"; 30import { Markdown } from "@/components/async";
31import { Component, Prop, Vue } from "vue-property-decorator"; 31import { Component, Prop, Vue } from "vue-property-decorator";
32 32
33@Component 33@Component({
34 components: {
35 Markdown,
36 },
37})
34export default class LdInformation extends Vue { 38export default class LdInformation extends Vue {
35 @Prop({ required: true }) readonly item!: Item; 39 @Prop({ required: true }) readonly item!: Item;
36 40
@@ -39,11 +43,6 @@ export default class LdInformation extends Vue {
39 const time = this.item.datetime.substr(11, 5); 43 const time = this.item.datetime.substr(11, 5);
40 return `${date} ${time}`; 44 return `${date} ${time}`;
41 } 45 }
42
43 get formatDescription() {
44 if (!this.item.description) return "";
45 return marked(this.item.description);
46 }
47} 46}
48</script> 47</script>
49 48