@planjs/utils
Version:
🔧 Common tools collection
16 lines (14 loc) • 356 B
JavaScript
/**
* 复制到剪切板
* @param textValue
* @category Bom
*/
function executeCopy(textValue) {
var input = document.createElement('textarea');
document.body.appendChild(input);
input.value = textValue;
input.select(); // 将内容复制到剪贴板里面去。
document.execCommand('Copy');
input.remove();
}
export default executeCopy;