GitHub buttons component for Vue.
npm install vue-github-buttons:octocat: GitHub buttons component for Vue.
- Vue GitHub Buttons
- Installation
- Demo
- Usage
- Using with Nuxt
- Module options
- css
- useCache
- Using with VuePress
- API
- Plugin Options
- useCache
- Components
- gh-btns-watch
- gh-btns-star
- gh-btns-fork
- gh-btns-follow
Via NPM:

``bash`
npm install vue-github-buttons
Via Yarn:
`bash`
yarn add vue-github-buttons
`javascript
import Vue from 'vue';
import VueGitHubButtons from 'vue-github-buttons';
import App from './App.vue';
// Stylesheet
import 'vue-github-buttons/dist/vue-github-buttons.css';
Vue.use(VueGitHubButtons);
// Or if your don't want to use cache
Vue.use(VueGitHubButtons, { useCache: false });
new Vue({
el: '#app',
render: h => h(App)
});
`
`vue
`
Add vue-github-buttons/nuxt to modules in nuxt.config.js.
`javascript`
module.exports = {
modules: [
'vue-github-buttons/nuxt',
// Or with options
['vue-github-buttons/nuxt', {
css: false, // Don't include CSS
useCache: false // Don't use cache
}]
]
};
#### cssBoolean
Type: true
Default:
Include Vue GitHub Buttons's CSS.
#### useCacheBoolean
Type: true
Default:
Enable caching. (See below)
> Require VuePress v1.x
Add Vue GitHub Buttons to your plugins in .vuepress/config.js.
`javascript
module.exports = {
plugins: [
require('vue-github-buttons/plugins/vuepress'),
/ Or using plugin with options /
[
require('vue-github-buttons/plugins/vuepress'),
{
useCache: false
}
]
]
}
`
Plugin options are the same as Vue plugin options.
#### useCacheBoolean
Type: true
Default:
Enable count number caching. (Use session storage)
> GitHub API has limited requests. So, caching may be useful when user refresh the webpage.
`javascript`
Vue.use(VueGitHubButtons, { useCache: false }); // Disable cache
#### gh-btns-watchslug
šļø A watch button.
- - GitHub slug (username/repo).show-count
- - Enable displaying the count number.
#### gh-btns-starslug
ā A star button.
- - GitHub slug (username/repo).show-count
- - Enable displaying the count number.
#### gh-btns-forkslug
š“ A fork button.
- - GitHub slug (username/repo).show-count
- - Enable displaying the count number.
#### gh-btns-followuser
š¤ A follow button.
- - GitHub username.show-count` - Enable displaying the count number.
-