Vue GitHub Buttons

3.1.0 · abandoned · verified Sun Apr 19

Vue GitHub Buttons is a Vue 2 component library that provides pre-styled, functional components for displaying various GitHub buttons, such as 'watch', 'star', 'fork', and 'follow', complete with dynamic count fetching from the GitHub API. The latest stable version is 3.1.0, released in April 2020. Given the lack of activity since then, the project is considered abandoned, and no further updates or security patches are anticipated. Key features include built-in caching to mitigate GitHub API rate limits, and dedicated integration modules for Nuxt.js and VuePress 1.x. Version 3.0.0 marked a shift from Axios to the native Fetch API for network requests, which may necessitate polyfills for older browser environments.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to install, import, and register `vue-github-buttons` as a Vue plugin. It then uses the provided components like `<gh-btns-star>`, `<gh-btns-follow>`, and `<gh-btns-fork>` within a basic Vue application, showing how to display counts and configure basic options.

import Vue from 'vue';
import VueGitHubButtons from 'vue-github-buttons';
import 'vue-github-buttons/dist/vue-github-buttons.css';

Vue.use(VueGitHubButtons, { useCache: true }); // Enable caching to reduce GitHub API calls

const App = {
  template: `
    <div id="app">
      <h1>GitHub Buttons Example</h1>
      <p>Star the Vue.js repository:</p>
      <gh-btns-star slug="vuejs/vue" show-count></gh-btns-star>
      <p>Follow Evan You (creator of Vue.js):</p>
      <gh-btns-follow user="yyx990803" show-count></gh-btns-follow>
      <p>Fork this project:</p>
      <gh-btns-fork slug="gluons/vue-github-buttons" show-count></gh-btns-fork>
    </div>
  `
};

new Vue({
  el: '#app',
  render: h => h(App)
});

view raw JSON →