diff --git a/components/content/RefArticle.vue b/components/content/RefArticle.vue index 07fe459ea76493972074696ac580edfd713214e3..4cc33399d7d4643541c323224f79055d42cc6bb7 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>