渲染 github 分叉按钮

Render github fork button

我想在按下另一个按钮时正确呈现 "reload" github 按钮。我搜索了 this information,但我做不到,我遇到了另一个错误:

Uncaught Error: Module name "github-buttons" has not been loaded yet for context: _. Use require([]).

当我包含 http://requirejs.org/docs/release/2.2.0/minified/require.js

Node.JS is a server-side technology, not a browser technology. Thus, Node-specific calls, like require(), do not work in the browser.

See browserify or webpack if you wish to serve browser-specific modules from Node.

但是您可以使用他们的步骤来制作此按钮...

Usage:

  1. Place this tag where you want the button to render
<a class="github-button" href="https://github.com/microsmsm" data-
size="large" aria-label="Follow @microsmsm on GitHub">Follow 
@microsmsm</a>
  1. Place this tag in your head or just before your close body tag
<script async defer src="https://buttons.github.io/buttons.js"></script>

代码示例:

https://codepen.io/Microsmsm/pen/NvJaNm?editors=1100

参考:

https://buttons.github.io/