easy-clipboard
clipboard.js 是一个非常好用的剪切板插件,但是随着前端框架的演变,用户与网页交互的方式越来越多,不仅限于点击事件了,并且在很多情况下,我们可能不需要它强制性自带的点击事件,所以我打算把 clipboard.js 精简一下,把点击事件删掉,这就是本插件的初衷。
1,982
6
| Install | |
|---|---|
npm install easy-clipboard |
|
| Latest Version: | 1.1.0 |
| Vue: | 2 |
| License: | MIT |
| Last Updated: | Dec 12, 2022 |
| Links: | GitHub · npm |
Maintainer: candy8ullet
easy-clipboard
clipboard.js 的简化版,去掉了点击事件,提升了易用性
clipboard.js 是一个非常好用的剪切板插件,但是随着前端框架的演变,用户与网页交互的方式越来越多,不仅限于点击事件了,并且在很多情况下,我们可能不需要它强制性自带的点击事件,所以我打算把 clipboard.js 精简一下,把点击事件删掉,这就是本插件的初衷。
Getting Started
install
To begin with, just install easy-clipboard:
npm i easy-clipboard -s
Then,you can use it like this:
import clipboard from 'easy-clipboard';
// copy some text directly
clipboard.copy('some text');
// copy the whole dom by some node
const node = document.querySelector(selector)
clipboard.copy(node);
// copy whatever dom you return
clipboard.copy(() => document.querySelector('.haha'));
TODO
- 精简clipboard.js
- 用 ts 重写
- 用 rollup 打包
- 添加 demo
- 用 jest 测试
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 1.1.0 | ^2.6.11 | MIT | |
| 1.0.7 | ^2.6.11 | MIT | |
| 1.0.6 | ^2.6.11 | MIT | |
| 1.0.5 | ^2.6.11 | MIT | |
| 1.0.4 | ^2.6.11 | MIT | |
| 1.0.3 | ^2.6.11 | MIT | |
| 1.0.2 | ^2.6.11 | MIT | |
| 1.0.1 | ^2.6.11 | MIT | |
| 1.0.0 | MIT |