An open API service indexing awesome lists of open source software.

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

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');

```