1.1.0 • Published 4 years ago

easy-clipboard v1.1.0

Weekly downloads
15
License
MIT
Repository
github
Last release
4 years ago

easy-clipboard

Codecov NPM version NPM downloads NPM license

clipboard.js 的简化版,去掉了点击事件,提升了易用性

clipboard.js 是一个非常好用的剪切板插件,但是随着前端框架的演变,用户与网页交互的方式越来越多,不仅限于点击事件了,并且在很多情况下,我们可能不需要它强制性自带的点击事件,所以我打算把 clipboard.js 精简一下,把点击事件删掉,这就是本插件的初衷。

demo

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 测试
1.1.0

4 years ago

1.0.7

4 years ago

1.0.2

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago