Skip to content

Commit 531313e

Browse files
committed
docs: reorder
1 parent ecaf2d5 commit 531313e

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

packages/docs/.vitepress/theme/components/HomeSponsorsGroup.vue

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
<script setup lang="ts">
2+
import sponsors from './sponsors.json'
3+
import { computed } from 'vue'
4+
import { useData } from 'vitepress'
5+
6+
const props = withDefaults(
7+
defineProps<{
8+
name: 'Gold' | 'Platinum' | 'Silver' | 'Bronze'
9+
size?: number | string
10+
}>(),
11+
{
12+
size: 140,
13+
}
14+
)
15+
16+
const { isDark } = useData()
17+
18+
const list = computed(() =>
19+
sponsors[props.name.toLowerCase()].map(sponsor => ({
20+
...sponsor,
21+
imgSrc: isDark.value ? sponsor.imgSrcDark : sponsor.imgSrcLight,
22+
}))
23+
)
24+
</script>
25+
126
<template>
227
<h3>{{ name }} Sponsors</h3>
328

@@ -28,30 +53,6 @@
2853
</p>
2954
</template>
3055

31-
<script setup lang="ts">
32-
import sponsors from './sponsors.json'
33-
import { computed } from 'vue'
34-
import { useData } from 'vitepress'
35-
36-
interface Props {
37-
name: 'Gold' | 'Platinum' | 'Silver' | 'Bronze'
38-
size?: number | string
39-
}
40-
41-
const props = withDefaults(defineProps<Props>(), {
42-
size: 140,
43-
})
44-
45-
const { isDark } = useData()
46-
47-
const list = computed(() =>
48-
sponsors[props.name.toLowerCase()].map((sponsor) => ({
49-
...sponsor,
50-
imgSrc: isDark.value ? sponsor.imgSrcDark : sponsor.imgSrcLight,
51-
}))
52-
)
53-
</script>
54-
5556
<style scoped>
5657
.sponsor_wrapper {
5758
padding: 5px;

0 commit comments

Comments
 (0)