GitHub buttons

Star
Follow

Showcase your GitHub repo's success with hotlinkable GitHub star, fork, issue, download or follow buttons.

Demo

React

Watch
Star
Fork
Follow
Issue
Download

Vue

Watch
Star
Fork
Follow
Issue
Download

Installation

Via NPM:

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>

Usage

    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>

API

props

Property Description Type Default Optional
repository github repository, eg: facebook/react String
type button type String star star, fork, watch, follow, issue, download

events

Event Name Description Return Value
on-updated Emitted when count loaded. Only when the type is equal to star, fork, watch count

License

MIT

Fork me on GitHub