fix: Use withBase method for app images on documentation
This commit is contained in:
@@ -1,12 +1,24 @@
|
||||
<script setup>
|
||||
import { useData } from 'vitepress';
|
||||
import { computed } from 'vue';
|
||||
import { useData, withBase } from 'vitepress';
|
||||
import { VPTeamMembers } from 'vitepress/theme';
|
||||
|
||||
const props = defineProps(['favicon']);
|
||||
|
||||
const { frontmatter: fm } = useData();
|
||||
|
||||
const computedItems = computed(() => {
|
||||
const itemsLength = fm.value.items?.length;
|
||||
|
||||
if (!itemsLength) return [];
|
||||
|
||||
return fm.value.items.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
avatar: withBase(fm.value.favicon),
|
||||
};
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VPTeamMembers size="small" :members="fm.items" />
|
||||
<VPTeamMembers size="small" :members="computedItems" />
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user