Showcase your GitHub repo's success with hotlinkable GitHub star, fork, issue, download or follow buttons.
Via NPM:
Via Yarn:
yarn add vue-ghbtns
Via CDN:
<script src="//vuejs.org/js/vue.min.js"></script>
<script src="//unpkg.com/vue-ghbtns/dist/index.min.js"></script>
import Vue from 'vue'
import GitHubButtons from 'vue-ghbtns'
Vue.use(GitHubButtons)
new Vue({
el: '#app',
methods: {
updated(count) {
console.log('update:' + count)
}
}
})
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Github Buttons</title>
</head>
<body>
<div id="app">
<GitHubButtons repository="vuejs/vue" type="watch" @on-updated="updated"></GitHubButtons>
<GitHubButtons repository="vuejs/vue" type="star" @on-updated="updated"></GitHubButtons>
<GitHubButtons repository="vuejs/vue" type="fork" @on-updated="updated"></GitHubButtons>
<GitHubButtons repository="vuejs/vue" type="follow"></GitHubButtons>
<GitHubButtons repository="vuejs/vue" type="issue"></GitHubButtons>
<GitHubButtons repository="vuejs/vue" type="download"></GitHubButtons>
</div>
</body>
</html>
Property | Description | Type | Default | Optional |
---|---|---|---|---|
repository | github repository, eg: facebook/react | String | ||
type | button type | String | star | star, fork, watch, follow, issue, download |
Event Name | Description | Return Value |
---|---|---|
on-updated | Emitted when count loaded. Only when the type is equal to star, fork, watch | count |
MIT