[+] Title and subtitle

This commit is contained in:
Hykilpikonna
2021-12-25 12:19:31 -05:00
parent 2b65e22369
commit d8106817d5
+28 -19
View File
@@ -1,12 +1,14 @@
<template> <template>
<div id="Publication"> <div id="Publication">
<div id="title">{{d.title}}</div>
<div id="subtitle">By {{d.creators.map(it => it.firstName + ' ' + it.lastName).join(' & ')}}{{date ? ', ' + date.year() : ''}}</div>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import {Options, Vue} from 'vue-class-component'; import {Options, Vue} from 'vue-class-component';
import {Prop} from "vue-property-decorator"; import {Prop} from "vue-property-decorator";
import moment from "moment";
export interface ZoteroLink export interface ZoteroLink
{ {
@@ -25,6 +27,26 @@ export interface ZoteroCreator
lastName: string lastName: string
} }
export interface ZoteroData
{
key: string
itemType: string // 'document'
title: string
creators: ZoteroCreator[]
abstractNote?: string
publisher?: string
date?: string // 'Dec 9 2021'
language?: string // 'en'
shortTitle?: string
url?: string
accessDate?: string
archive?: string
archiveLocation?: string
libraryCatalog?: string
rights?: string
extra?: string
}
export interface ZoteroItem export interface ZoteroItem
{ {
key: string key: string
@@ -40,30 +62,17 @@ export interface ZoteroItem
parsedDate: string // 2021-12-09 parsedDate: string // 2021-12-09
numChildren: 1 numChildren: 1
} }
data: { data: ZoteroData
key: string
itemType: string // 'document'
title: string
creators: ZoteroCreator[]
abstractNote?: string
publisher?: string
date?: string // 'Dec 9 2021'
language?: string // 'en'
shortTitle?: string
url?: string
accessDate?: string
archive?: string
archiveLocation?: string
libraryCatalog?: string
rights?: string
extra?: string
}
} }
@Options({components: {}}) @Options({components: {}})
export default class ZoteroPublicationView extends Vue export default class ZoteroPublicationView extends Vue
{ {
@Prop({required: true}) item!: ZoteroItem @Prop({required: true}) item!: ZoteroItem
get d(): ZoteroData { return this.item.data }
get date(): moment.Moment { return moment(this.d.date) }
} }
</script> </script>