mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-25 17:26:15 -04:00
feat(page): added /about page
This commit is contained in:
parent
1ac0cbdd68
commit
ee74b6d469
2 changed files with 138 additions and 19 deletions
51
components/GithubContributors.vue
Normal file
51
components/GithubContributors.vue
Normal file
|
@ -0,0 +1,51 @@
|
|||
<template>
|
||||
<div class="github-contributor">
|
||||
<v-list class="pa-0">
|
||||
<v-list-item v-for="(contributor, i) in contributors" :key="i" :href="contributor.html_url" target="_blank" rel="noopener noreferrer">
|
||||
<v-list-item-avatar>
|
||||
<v-img :src="contributor.avatar_url" />
|
||||
</v-list-item-avatar>
|
||||
<v-list-item-content>
|
||||
{{ contributor.login }}
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {Component, Vue} from 'nuxt-property-decorator'
|
||||
|
||||
import axios from 'axios'
|
||||
const url = 'https://api.github.com/repos/CorentinTh/it-tools/contributors'
|
||||
|
||||
interface IGithubContributors {
|
||||
contributions: number;
|
||||
// eslint-disable-next-line camelcase
|
||||
avatar_url: string;
|
||||
login: string;
|
||||
type: 'User' | 'Bot'
|
||||
}
|
||||
|
||||
@Component
|
||||
export default class GithubContributors extends Vue {
|
||||
contributors: IGithubContributors[] = []
|
||||
fetchOnServer = true
|
||||
|
||||
fetch() {
|
||||
axios
|
||||
.get(url)
|
||||
.then(({data}: {data: IGithubContributors[]}) => {
|
||||
this.contributors = data.filter(u => u.type === 'User').sort((a, b) => b.contributions - a.contributions)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.github-contributor{
|
||||
.v-list {
|
||||
background: transparent !important;
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue