1.0.4 • Published 2 years ago

clipboard-img v1.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

clipboard

a tool for copying images

install

npm i clipboard-img -S

use

import {copy} from 'clipboard-img'

support

copy('可以是一个图片链接').then()
copy('可以是一个图片Dom元素(img标签)').then()
copy('可以是一个包含多个dom的dom元素').then()
copy('可以是一个base64编码的图片').then()

Simple example

<div id="con">
    <img src="" />
    <h1>复制复制</h1>
</div>

// 脚本中
copy(document.getElementById('con')).then()

compatibility

浏览器兼容https://caniuse.com/?search=%20Navigator%20API%3Aclipboard

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago