copy-text-to-clipboard

2018-12-09 admin

copy-text-to-clipboard是什么

什么是copy-text-to-clipboard,Copy text to the clipboard in modern browsers (0.2 kB)

copy-text-to-clipboard使用教程帮助文档

copy-text-to-clipboard Build Status

Copy text to the clipboard in modern browsers (0.2 kB)

Try it out!

Comparison

Install

$ npm install copy-text-to-clipboard

Usage

const copy = require('copy-text-to-clipboard');

button.addEventListener('click', () => {
	copy('🦄🌈');
});

API

copy(text)

Copy text to the clipboard.

Returns a boolean of whether it succeeded.

Must be called in response to a user gesture event, like click or keyup.

Related

  • clipboardy - Access the system clipboard (copy/paste) in Node.js

License

MIT © Sindre Sorhus

本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处。

转载请注明:文章转载自 JavaScript中文网 [https://www.javascriptcn.com]

本文地址:https://www.javascriptcn.com/read-47718.html

文章标题:copy-text-to-clipboard

回到顶部