拷贝文本到剪贴板 – copy-text-to-clipboard

copy-text-to-clipboard

拷贝文本到剪贴板

安装

$ npm install copy-text-to-clipboard

使用

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

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

API

copy(text)

Copytextto the clipboard.

Returns abooleanof whether it succeeded.

Must be called in response to a user gesture event, likeclickorkeyup.

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:拷贝文本到剪贴板 – copy-text-to-clipboard