Skip to content

Commit

Permalink
fix: fix authors no reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Nov 30, 2023
1 parent e53f192 commit de5f2b7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/.vitepress/theme/Authors.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
import Author from './Author.vue'
const { frontmatter } = useData()
const coAuthors = frontmatter.value.co_authors ?? []
const authors = [frontmatter.value.author, ...coAuthors]
const authors = computed(() => {
const coAuthors = frontmatter.value.co_authors ?? []
return [frontmatter.value.author, ...coAuthors]
})
</script>

<template>
Expand All @@ -15,7 +18,7 @@ const authors = [frontmatter.value.author, ...coAuthors]
<ul
class="flex flex-col pl-10 space-y-5 md:justify-center md:flex-row md:space-y-0 md:space-x-12 md:pl-0 xl:block xl:space-x-0 xl:space-y-8"
>
<template v-for="author in authors">
<template v-for="author in authors" :key="author.name">
<Author :name="author.name" :github="author.github" :avatar="author.avatar" />
</template>
</ul>
Expand Down

0 comments on commit de5f2b7

Please sign in to comment.