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

fix issue with ref display

parent 536ac400
No related branches found
No related tags found
No related merge requests found
Pipeline #127898 waiting for manual action with stages
in 6 minutes and 44 seconds
...@@ -8,20 +8,11 @@ export interface Props { ...@@ -8,20 +8,11 @@ export interface Props {
doi: string; doi: string;
} }
const props = withDefaults(defineProps<Props>(), {}); const props = withDefaults(defineProps<Props>(), {});
const article = ref<WikiArticle | undefined>(undefined) const { article } = await useFetchArticle(props.doi);
// 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
})
</script> </script>
<template> <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 ">{{ :class="theme.global.current.value.dark ? 'text-grey-lighten-1' : 'text-grey-darken-2'" class="pa-0 ">{{
article?.author?.[0]?.family }} et al, article?.author?.[0]?.family }} et al,
{{ article?.year }}</NuxtLink> {{ article?.year }}</NuxtLink>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment