vue-github-buttons
GitHub buttons component for Vue.
Last updated 4 months ago by illuminator .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install vue-github-buttons 
SYNC missed versions from official npm registry.

Vue GitHub Buttons

license vue 2 npm npm Travis Codacy grade ESLint Gluons

:octocat: GitHub buttons component for Vue.

Installation

Via NPM:

NPM

npm install vue-github-buttons

Via Yarn:

yarn add vue-github-buttons

Demo

Go to https://gluons.github.io/vue-github-buttons

Usage

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)
});
<template>
	<div id="app">
		<gh-btns-watch slug="vuejs/vue" show-count></gh-btns-watch>
		<gh-btns-star slug="vuejs/vue" show-count></gh-btns-star>
		<gh-btns-fork slug="vuejs/vue" show-count></gh-btns-fork>
		<gh-btns-follow user="yyx990803" show-count></gh-btns-follow>
	</div>
</template>

<script>
// JavaScript ...
</script>

<style>
/* Style ... */
</style>

Using with Nuxt

Add vue-github-buttons/nuxt to modules in nuxt.config.js.

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
		}]
	]
};

Module options

css

Type: Boolean
Default: true

Include Vue GitHub Buttons's CSS.

useCache

Type: Boolean
Default: true

Enable caching. (See below)

Using with VuePress

Require VuePress v1.x

Add Vue GitHub Buttons to your plugins in .vuepress/config.js.

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.

API

Plugin Options

useCache

Type: Boolean
Default: true

Enable count number caching. (Use session storage)

GitHub API has limited requests. So, caching may be useful when user refresh the webpage.

Vue.use(VueGitHubButtons, { useCache: false }); // Disable cache

Components

gh-btns-watch

????️ A watch button.

  • slug - GitHub slug (username/repo).
  • show-count - Enable displaying the count number.

gh-btns-star

⭐ A star button.

  • slug - GitHub slug (username/repo).
  • show-count - Enable displaying the count number.

gh-btns-fork

???? A fork button.

  • slug - GitHub slug (username/repo).
  • show-count - Enable displaying the count number.

gh-btns-follow

???? A follow button.

  • user - GitHub username.
  • show-count - Enable displaying the count number.

Current Tags

  • 3.1.0-beta.0                                ...           beta (4 months ago)
  • 3.1.0                                ...           latest (4 months ago)

21 Versions

  • 3.1.0                                ...           4 months ago
  • 3.1.0-beta.0                                ...           4 months ago
  • 3.0.2-beta.0                                ...           5 months ago
  • 3.0.1                                ...           6 months ago
  • 3.0.0                                ...           6 months ago
  • 3.0.0-beta.0                                ...           6 months ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.5                                ...           2 years ago
  • 2.0.4                                ...           2 years ago
  • 2.0.3                                ...           2 years ago
  • 2.0.2                                ...           2 years ago
  • 2.0.1                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 20
Last Day 1
Last Week 10
Last Month 76
Dependencies (3)
Dev Dependencies (42)

Copyright 2014 - 2017 © taobao.org |