File tree Expand file tree Collapse file tree 1 file changed +66
-0
lines changed Expand file tree Collapse file tree 1 file changed +66
-0
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,69 @@ vue-copy-to-cliboard
22----
33
44Copy to clipboard Vue component
5+
6+ ### Use
7+
8+ ``` bash
9+ $ npm install vue-copy-to-clipboard
10+ or
11+ $ yarn add vue-copy-to-clipboard
12+ ```
13+
14+
15+ ### Examples
16+
17+ ``` jsx
18+ // by jsx
19+ import CopyToClipboard from ' vue-copy-to-clipboard'
20+
21+ export default {
22+ data () {
23+ return {
24+ text: ' is copy content'
25+ }
26+ },
27+ render (h ) {
28+ return (
29+ < div>
30+ < CopyToClipboard text= {this .text } onCopy= {(result ) => {
31+ console .log (' onCopy' , result)
32+ }}>
33+ < Button> Copy to Clipboard< / Button>
34+ < / CopyToClipboard>
35+ < / div>
36+ )
37+ }
38+ }
39+ ```
40+
41+ ``` vue
42+ <template>
43+ <div>
44+ <copy-to-clipboard :text="text" @copy="handleCopy">
45+ <a-button>Copy to Clipboard</a-button>
46+ </copy-to-clipboard>
47+ </div>
48+ </template>
49+
50+ <script>
51+ // by template.vue
52+ import CopyToClipboard from 'vue-copy-to-clipboard'
53+
54+ export default {
55+ components: {
56+ CopyToClipboard
57+ },
58+ data () {
59+ return {
60+ text: '这里可以动态生成内容'
61+ }
62+ },
63+ methods: {
64+ handleCopy (result) {
65+ console.log('onCopy', result)
66+ }
67+ }
68+ }
69+ </script>
70+ ```
You can’t perform that action at this time.
0 commit comments