Skip to content
Snippets Groups Projects
Commit 0cad159a authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

can display enumerate on list article doi

parent 4d09ff9c
No related branches found
No related tags found
1 merge request!5Optional title abstract
Pipeline #111412 failed
<script setup lang="ts">
import { useDisplay } from 'vuetify'
const props = defineProps<{
export interface Props {
index: number
doi: string
divider: boolean
enumerate: boolean
title?: string
abstract?: string
}>();
}
const props = withDefaults(defineProps<Props>(), {
enumerate: true,
})
const { article } = useFetchArticle(props.doi)
const { mobile } = useDisplay()
const show = ref(false)
console.log(article)
const articleTitle = computed(() => { return props?.title ?? article.value?.title ?? props.doi })
const articleAbstract = computed(() => { return props.abstract ?? article.value?.abstract })
......@@ -20,7 +23,7 @@ const articleAbstract = computed(() => { return props.abstract ?? article.value?
</script>
<template>
<v-list-item :href="article?.href" :target="article?.target" density="compact" class="px-0">
<template #prepend v-if="!mobile">
<template #prepend v-if="!mobile && enumerate">
<v-avatar color="primary" size="small" density="compact" variant="tonal">
{{ props.index }}
</v-avatar>
......@@ -34,7 +37,7 @@ const articleAbstract = computed(() => { return props.abstract ?? article.value?
<v-card-item density="compact" :class="mobile ? 'px-0' : null">
<v-card-title><span class="text-subtitle-1 font-weight-bold">{{ articleTitle
}}</span></v-card-title>
<v-card-subtitle> {{ article?.subtitle ?? "no subtitle" }}</v-card-subtitle>
<v-card-subtitle> {{ article?.subtitle ?? "no authors" }}</v-card-subtitle>
<v-card-subtitle> {{ article?.containerTitle ?? "no containerTitle" }} ({{ article?.year
}})</v-card-subtitle>
</v-card-item>
......
......@@ -38,7 +38,8 @@ function filterOnlyCapsText(value, query, item) {
</template>
<template #[`item.article`]="{ item }">
<ArticleDoi v-if="item.columns?.article" :doi="item.columns.article.doi"
:title="item.columns.article?.title" :abstract="item.columns.article?.abstract" :divider="false" />
:title="item.columns.article?.title" :abstract="item.columns.article?.abstract" :divider="false"
:enumerate="false" />
</template>
</v-data-table>
</v-card>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment