2022-04-08 00:40:25 +08:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed } from 'vue'
|
2022-04-08 14:17:44 +08:00
|
|
|
import _contributors from '@element-plus/metadata/dist/contributors.json'
|
2022-04-08 00:40:25 +08:00
|
|
|
import VpLink from '../common/vp-link.vue'
|
|
|
|
|
|
|
|
const props = defineProps<{ id: string }>()
|
|
|
|
|
2022-09-29 11:15:38 +08:00
|
|
|
const contributors = computed(() =>
|
|
|
|
_contributors[props.id]?.filter((c) => c.login !== 'renovate[bot]')
|
|
|
|
)
|
2023-03-14 19:02:58 +08:00
|
|
|
|
|
|
|
const withSize = (rawURL: string) => {
|
|
|
|
return `${rawURL}${rawURL.includes('?') ? '&' : '?'}size=64`
|
|
|
|
}
|
2022-04-08 00:40:25 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="mb-4">
|
|
|
|
<div class="flex flex-wrap gap-4 pt-2">
|
|
|
|
<div v-for="c of contributors" :key="c.hash">
|
2022-04-12 20:14:08 +08:00
|
|
|
<vp-link
|
2022-04-08 00:40:25 +08:00
|
|
|
:href="`https://github.com/${c.login}`"
|
|
|
|
class="flex gap-2 items-center link"
|
|
|
|
no-icon
|
|
|
|
>
|
2023-03-14 19:02:58 +08:00
|
|
|
<img
|
|
|
|
:src="withSize(c.avatar)"
|
|
|
|
class="w-8 h-8 rounded-full"
|
|
|
|
loading="lazy"
|
|
|
|
/>
|
2022-04-08 00:40:25 +08:00
|
|
|
{{ c.name }}
|
2022-04-12 20:14:08 +08:00
|
|
|
</vp-link>
|
2022-04-08 00:40:25 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.link {
|
|
|
|
color: var(--text-color-light);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: var(--brand-color);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|