https://github.com/vuecomponent/vue-copy-to-clipboard
Copy to clipboard Vue component
https://github.com/vuecomponent/vue-copy-to-clipboard
Last synced: 5 months ago
JSON representation
Copy to clipboard Vue component
- Host: GitHub
- URL: https://github.com/vuecomponent/vue-copy-to-clipboard
- Owner: vueComponent
- Created: 2020-05-14T10:24:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-06-26T16:58:56.000Z (6 months ago)
- Last Synced: 2025-06-27T18:58:28.586Z (5 months ago)
- Language: JavaScript
- Size: 42 KB
- Stars: 16
- Watchers: 3
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
vue-copy-to-cliboard
----
Copy to clipboard Vue component
### Use
```bash
$ npm install vue-copy-to-clipboard
or
$ yarn add vue-copy-to-clipboard
```
### Examples
```jsx
// by jsx
import CopyToClipboard from 'vue-copy-to-clipboard'
export default {
data () {
return {
text: 'is copy content'
}
},
render (h) {
return (
{
console.log('onCopy', result)
}}>
Copy to Clipboard
)
}
}
```
```vue
Copy to Clipboard
// by template.vue
import CopyToClipboard from 'vue-copy-to-clipboard'
export default {
components: {
CopyToClipboard
},
data () {
return {
text: '这里可以动态生成内容'
}
},
methods: {
handleCopy (result) {
console.log('onCopy', result)
}
}
}
```