Skip to content

Commit 3851eb0

Browse files
committed
fix: es
1 parent 59e6d7d commit 3851eb0

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

index.js

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
1-
import copy from 'copy-to-clipboard'
1+
import copy from 'copy-to-clipboard';
22

3-
export const CopyToClipboardProps = {
3+
export var CopyToClipboardProps = {
44
text: {
55
type: String,
66
required: true
77
},
88
options: {
99
type: Object,
10-
default: () => {}
10+
'default': function _default() {
11+
return null;
12+
}
1113
}
12-
}
14+
};
1315

14-
const CopyToClipboard = {
16+
var CopyToClipboard = {
1517
name: 'VueCopyToClipboard',
1618
functional: true,
1719
props: CopyToClipboardProps,
18-
render (h, ctx) {
19-
const { props: { text, options = {} }, listeners: { copy: onCopy } } = ctx
20-
21-
const handleClick = (e) => {
20+
render: function (h, ctx) {
21+
var props = ctx.props,
22+
listeners = ctx.listeners,
23+
children = ctx.children;
24+
var text = props.text,
25+
options = props.options || {};
26+
var onCopy = listeners.copy
27+
28+
function handleClick(e) {
2229
// Bypass onClick if it was present
2330
e.preventDefault()
2431
e.stopPropagation()
@@ -30,13 +37,13 @@ const CopyToClipboard = {
3037
}
3138
}
3239

33-
return h('span', { on: { click: handleClick }}, ctx.children)
40+
return h('span', { on: { 'click': handleClick }}, children);
3441
}
35-
}
42+
};
3643

3744
/* istanbul ignore next */
3845
CopyToClipboard.install = function (Vue) {
3946
Vue.component(CopyToClipboard.name, CopyToClipboard)
40-
}
47+
};
4148

42-
export default CopyToClipboard
49+
export default CopyToClipboard;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-copy-to-clipboard",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Copy to clipboard Vue component",
55
"main": "index.js",
66
"repository": "https://github.com/vueComponent/vue-copy-to-clipboard",

0 commit comments

Comments
 (0)