https://github.com/gitbu/vue-clipboard-plus
copy to clipboard, support vue2 or vue3
https://github.com/gitbu/vue-clipboard-plus
Last synced: 4 months ago
JSON representation
copy to clipboard, support vue2 or vue3
- Host: GitHub
- URL: https://github.com/gitbu/vue-clipboard-plus
- Owner: gitbu
- Created: 2021-05-16T10:35:08.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T10:49:46.000Z (about 5 years ago)
- Last Synced: 2025-08-08T13:21:32.014Z (11 months ago)
- Language: HTML
- Size: 36.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 安装
```bash
npm i -S @aiping/vue-clipboard-plus
```
## 样例
### vue2
```html
Document
复制
Vue.use(vueClipBoard);
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
},
methods: {
handleClick() {
this.$copyText('hello world').then(e => {
console.log(e);
})
}
},
})
```
### vue3
```html
Document
复制
const app = Vue.createApp({
methods: {
handleClick() {
this.$copyText('hello world').then(e => {
console.log(e);
})
}
},
});
app.use(vueClipBoard);
app.mount('#app');
```