-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
725 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
node_modules | ||
dist | ||
mock.ts | ||
build | ||
build | ||
.vscode | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Generated by 'unplugin-auto-import' | ||
export {} | ||
declare global { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// generated by unplugin-vue-components | ||
// We suggest you to commit this file into source control | ||
// Read more: https://github.com/vuejs/core/pull/3399 | ||
import '@vue/runtime-core' | ||
|
||
export {} | ||
|
||
declare module '@vue/runtime-core' { | ||
export interface GlobalComponents { | ||
Config: typeof import('./src/components/Config.vue')['default'] | ||
DisplaySVG: typeof import('./src/components/DisplaySVG.vue')['default'] | ||
ElMenu: typeof import('element-plus/es')['ElMenu'] | ||
ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] | ||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] | ||
Footer: typeof import('./src/components/Footer.vue')['default'] | ||
} | ||
export interface ComponentCustomProperties { | ||
vLoading: typeof import('element-plus/es')['ElLoadingDirective'] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
|
||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Config.vue" | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<script setup lang="ts"> | ||
import {ref} from 'vue' | ||
import {ElButton, ElInput, ElNotification} from 'element-plus' | ||
import axios from 'axios' | ||
import {sortBy} from 'lodash' | ||
import {BottomRight} from '@element-plus/icons-vue' | ||
import {getOwnerRepo, getTotalList} from '@/utils' | ||
import {mockData} from '../mock' | ||
import veabaSvg from '../../repos/veaba/contributors.svg' | ||
import docsZhCN from '../../repos/vuejs-translations/docs-zh-cn.svg' | ||
import circleSVG from '../assets/circle.svg' | ||
const veabaSvgData = veabaSvg | ||
const docsZhCNData = docsZhCN | ||
const circleSVGData = circleSVG | ||
const defaultSort = sortBy(mockData, (o) => -o.total) || [] | ||
const sortList = getTotalList(defaultSort, {ignoreTotal: 0, ignore: []}) | ||
/* ******************** ref ******************* */ | ||
const repo = ref('vuejs-translations/docs-zh-cn') | ||
const loading = ref(false) | ||
const originData = ref(sortList || []) | ||
const onSearch = () => { | ||
const {owner, repo: repoName} = getOwnerRepo(repo.value) | ||
if (!owner || !repoName) { | ||
ElNotification({ | ||
title: 'Please check it', | ||
type: 'error', | ||
message: 'it\'s a legal Github repo, it should be link: vuejs-translations/docs-zh-cn' | ||
}) | ||
return | ||
} | ||
getGithubContributors(`${owner}/${repoName}`) | ||
} | ||
const onChange = (t: string) => { | ||
console.info('t=>', t); | ||
} | ||
const getGithubContributors = async (repoKey: string) => { | ||
let repData = [] | ||
try { | ||
loading.value = true | ||
const resp = await axios.get(`http://api.github.com/repos/${repoKey}/stats/contributors`) | ||
if (resp?.data) { | ||
repData = resp.data || [] | ||
// console.log('sort totalList=>', _.sortBy(totalList, function (o) { return o.total })) | ||
originData.value = sortBy(repData, (o) => o.total); | ||
// const cleanData = getTotalList(repData) | ||
} | ||
loading.value = false | ||
console.log('res data==>', resp) | ||
} catch (err) { | ||
console.error('get repo stats contributors err=>', err) | ||
} | ||
} | ||
</script> | ||
<template> | ||
<div class="searchBody"> | ||
<el-input v-loading.fullscreen.lock="loading" size="large" v-model="repo" | ||
placeholder="Please input a repo: {owner}/{repo}" | ||
@change="onChange"> | ||
<template #append> | ||
<ElButton type="primary" :disabled="loading" :loading="loading" @click="onSearch">Go</ElButton> | ||
</template> | ||
</el-input> | ||
</div> | ||
|
||
<h1> SVG veaba/contributor demo</h1> | ||
<!-- <div v-html="veabaSvgData" class="divSVG"></div>--> | ||
|
||
<!-- <h1> SVG vuejs-translations/docs-zh-cn demo</h1>--> | ||
<!-- <div v-html="docsZhCNData" class="divSVG"></div>--> | ||
|
||
<!-- <h1> SVG border-radius 1</h1>--> | ||
<!-- <div v-html="circleSVGData" class="divSVG"></div>--> | ||
|
||
</template> | ||
|
||
|
||
<style lang="scss" scoped> | ||
.searchBody { | ||
width: 400px; | ||
margin: 100px auto; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<template> | ||
<footer> | ||
Copyright @ 2022 <a href="https://github.com/veaba/" rel="noreferrer" target="_blank">veaba</a> | ||
</footer> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "Footer" | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import { createApp } from "vue"; | ||
import 'element-plus/dist/index.css' | ||
import App from './App.vue' | ||
|
||
createApp(App).mount('#app') | ||
createApp(App).mount('#app') |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.