From 40a6e02c81390394c688509225c096db6d9e180f Mon Sep 17 00:00:00 2001 From: Remi PLANEL <rplanel@pasteur.fr> Date: Fri, 5 Apr 2024 20:18:38 +0200 Subject: [PATCH] fix issue with ref display --- components/content/RefArticle.vue | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/components/content/RefArticle.vue b/components/content/RefArticle.vue index 07fe459e..4cc33399 100644 --- a/components/content/RefArticle.vue +++ b/components/content/RefArticle.vue @@ -8,20 +8,11 @@ export interface Props { doi: string; } const props = withDefaults(defineProps<Props>(), {}); -const article = ref<WikiArticle | undefined>(undefined) -// const { article } = useFetchArticle(props.doi); -onBeforeMount(async () => { - const { article: articleOnMounted } = await useFetchArticle(props.doi); - article.value = articleOnMounted.value -}) -onMounted(async () => { - const { article: articleOnMounted } = await useFetchArticle(props.doi); - article.value = articleOnMounted.value -}) +const { article } = await useFetchArticle(props.doi); </script> <template> - <NuxtLink v-if="article?.author?.length && article?.author?.length > 0" :href="`#ref-${props.doi}`" + <NuxtLink v-if="article?.author?.length > 0" :href="`#ref-${props.doi}`" :class="theme.global.current.value.dark ? 'text-grey-lighten-1' : 'text-grey-darken-2'" class="pa-0 ">{{ article?.author?.[0]?.family }} et al, {{ article?.year }}</NuxtLink> -- GitLab