Skip to content

Commit da3c1b2

Browse files
committed
Initial commit
0 parents  commit da3c1b2

File tree

6 files changed

+170
-0
lines changed

6 files changed

+170
-0
lines changed

.gitignore

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next

LICENSE

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
BSD 2-Clause License
2+
3+
Copyright (c) 2019, なつき
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
20+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
23+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# vue-github-button
2+
3+
``` vue
4+
<template>
5+
<github-button href="https://github.com/ntkme">Follow @ntkme</github-button>
6+
</template>
7+
8+
<script>
9+
import GithubButton from 'vue-github-button'
10+
11+
export default {
12+
components: {
13+
GithubButton
14+
}
15+
}
16+
</script>
17+
```

index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { render } from 'github-buttons'
2+
3+
export default {
4+
name: 'github-button',
5+
props: ['href', 'title', 'ariaLabel', 'dataIcon', 'dataSize', 'dataText', 'dataShowCount'],
6+
render: function (h) {
7+
return h('a', { attrs: {
8+
href: this.href,
9+
title: this.title,
10+
'aria-label': this.ariaLabel,
11+
'data-icon': this.dataIcon,
12+
'data-size': this.dataSize,
13+
'data-text': this.dataText,
14+
'data-show-count': this.dataShowCount
15+
} }, this.$slots.default)
16+
},
17+
mounted: function () {
18+
render(this.$el.parentNode.insertBefore(this._ = document.createElement('span'), this.$el).appendChild(this.$el))
19+
},
20+
beforeUpdate: function () {
21+
this._.parentNode.replaceChild(this.$el, this._)
22+
},
23+
updated: function () {
24+
render(this.$el.parentNode.insertBefore(this._ = document.createElement('span'), this.$el).appendChild(this.$el))
25+
}
26+
}

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "vue-github-button",
3+
"version": "0.1.0",
4+
"description": "GitHub button component for Vue.js",
5+
"main": "index.js",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/ntkme/vue-github-button.git"
9+
},
10+
"keywords": [
11+
"Vue",
12+
"GitHub",
13+
"button"
14+
],
15+
"author": {
16+
"name": "なつき",
17+
"email": "i@ntk.me",
18+
"url": "https://ntk.me/"
19+
},
20+
"license": "BSD-2-Clause",
21+
"bugs": {
22+
"url": "https://github.com/ntkme/vue-github-button/issues"
23+
},
24+
"homepage": "https://github.com/ntkme/vue-github-button#readme",
25+
"dependencies": {
26+
"github-buttons": "^1.0.0"
27+
}
28+
}

0 commit comments

Comments
 (0)