Skip to content

Commit fc673b8

Browse files
committed
v3.0.0
1 parent 22f6354 commit fc673b8

File tree

6 files changed

+52
-27
lines changed

6 files changed

+52
-27
lines changed

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 2-Clause License
22

3-
Copyright (c) 2020, なつき
3+
Copyright (c) 2021, なつき
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
## Installation
44

5+
#### Vue 3
6+
7+
``` sh
8+
npm install vue-github-button@next
9+
# OR
10+
yarn add vue-github-button@next
11+
```
12+
13+
#### Vue 2
14+
515
``` sh
616
npm install vue-github-button
717
# OR

index.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
import Vue from 'vue'

index.js

+20-18
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
1-
import Vue from 'vue'
1+
import { defineComponent, h } from 'vue'
2+
import { hyphenate } from '@vue/shared'
23

3-
export default Vue.extend({
4+
export default defineComponent({
45
name: 'github-button',
5-
props: ['href', 'ariaLabel', 'title', 'dataIcon', 'dataColorScheme', 'dataSize', 'dataShowCount', 'dataText'],
6-
render: function (h) {
6+
props: {
7+
href: String,
8+
ariaLabel: String,
9+
title: String,
10+
dataIcon: String,
11+
dataColorScheme: String,
12+
dataSize: String,
13+
dataShowCount: String,
14+
dataText: String
15+
},
16+
render: function () {
17+
const props = { ref: '_' }
18+
for (const key in this.$props) {
19+
props[hyphenate(key)] = this.$props[key]
20+
}
721
return h('span', [
8-
h('a', {
9-
attrs: {
10-
'href': this.href,
11-
'aria-label': this.ariaLabel,
12-
'title': this.title,
13-
'data-icon': this.dataIcon,
14-
'data-color-scheme': this.dataColorScheme,
15-
'data-size': this.dataSize,
16-
'data-show-count': this.dataShowCount,
17-
'data-text': this.dataText
18-
},
19-
ref: '_'
20-
}, this.$slots.default)
22+
h('a', props, this.$slots.default())
2123
])
2224
},
2325
mounted: function () {
@@ -29,7 +31,7 @@ export default Vue.extend({
2931
updated: function () {
3032
this.paint()
3133
},
32-
beforeDestroy: function () {
34+
beforeUnmount: function () {
3335
this.reset()
3436
},
3537
methods: {

package-lock.json

+19-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-github-button",
3-
"version": "1.3.0",
3+
"version": "3.0.0",
44
"description": "GitHub button component for Vue.js",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -24,6 +24,6 @@
2424
},
2525
"homepage": "https://buttons.github.io/",
2626
"dependencies": {
27-
"github-buttons": "^2.8.0"
27+
"github-buttons": "^2.14.1"
2828
}
2929
}

0 commit comments

Comments
 (0)