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

useFetch -> server :false

parent 649d3844
No related branches found
No related tags found
No related merge requests found
Pipeline #111776 passed
...@@ -22,41 +22,39 @@ const articleAbstract = computed(() => { return props.abstract ?? article.value? ...@@ -22,41 +22,39 @@ const articleAbstract = computed(() => { return props.abstract ?? article.value?
</script> </script>
<template> <template>
<ClientOnly> <v-list-item :href="article?.href" :target="article?.target" density="compact" class="px-1">
<v-list-item :href="article?.href" :target="article?.target" density="compact" class="px-1"> <template #prepend v-if="!mobile && enumerate">
<template #prepend v-if="!mobile && enumerate"> <v-avatar color="primary" size="small" density="compact" variant="tonal">
<v-avatar color="primary" size="small" density="compact" variant="tonal"> {{ props.index }}
{{ props.index }} </v-avatar>
</v-avatar> </template>
</template> <!-- <template #append v-if="!mobile">
<!-- <template #append v-if="!mobile">
<v-avatar> <v-avatar>
<v-icon>{{ article?.prependIcon }}</v-icon> <v-icon>{{ article?.prependIcon }}</v-icon>
</v-avatar> </v-avatar>
</template> --> </template> -->
<v-card flat color="transparent" density="compact" class="my-0"> <v-card flat color="transparent" density="compact" class="my-0">
<v-card-item density="compact" :class="mobile ? 'px-0' : null"> <v-card-item density="compact" :class="mobile ? 'px-0' : null">
<v-card-title><span class="text-subtitle-1 font-weight-bold">{{ articleTitle <v-card-title><span class="text-subtitle-1 font-weight-bold">{{ articleTitle
}}</span></v-card-title> }}</span></v-card-title>
<v-card-subtitle> {{ article?.subtitle ?? "no authors" }}</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> {{ article?.containerTitle ?? "no containerTitle" }} ({{ article?.year
}})</v-card-subtitle> }})</v-card-subtitle>
</v-card-item> </v-card-item>
<v-card-item density="compact" :class="mobile ? 'px-0' : null"> <v-card-item density="compact" :class="mobile ? 'px-0' : null">
<v-btn v-if="articleAbstract" size="x-small" variant="outlined" <v-btn v-if="articleAbstract" size="x-small" variant="outlined"
:append-icon="show ? 'mdi-chevron-up' : 'mdi-chevron-down'" :append-icon="show ? 'mdi-chevron-up' : 'mdi-chevron-down'"
@click.stop.prevent="show = !show">Abstract</v-btn> @click.stop.prevent="show = !show">Abstract</v-btn>
</v-card-item> </v-card-item>
<v-expand-transition> <v-expand-transition>
<v-card v-show="show" flat color="transparent"> <v-card v-show="show" flat color="transparent">
<v-card-text> <v-card-text>
{{ articleAbstract }} {{ articleAbstract }}
</v-card-text> </v-card-text>
</v-card> </v-card>
</v-expand-transition> </v-expand-transition>
</v-card> </v-card>
</v-list-item> </v-list-item>
<v-divider v-if="props.divider" inset></v-divider> <v-divider v-if="props.divider" inset></v-divider>
</ClientOnly>
</template> </template>
\ No newline at end of file
...@@ -42,6 +42,7 @@ export function useFetchArticle(doi: string) { ...@@ -42,6 +42,7 @@ export function useFetchArticle(doi: string) {
console.log("dans watch effect") console.log("dans watch effect")
article.value = null article.value = null
const { data, pending: pendingUseFetch, error, refresh } = await useFetch<RawArticle>(toValue(url), { const { data, pending: pendingUseFetch, error, refresh } = await useFetch<RawArticle>(toValue(url), {
lazy: true, server: false,
}) })
console.log(data) console.log(data)
if (data.value?.message) { if (data.value?.message) {
......
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