美文网首页程序之路
Creator中复制的操作

Creator中复制的操作

作者: kingURL | 来源:发表于2020-06-18 09:44 被阅读0次
private copyUrl() {
    let input = document.createElement("input"); // 直接构建input
    input.value = "110";   // 设置内容
    document.body.appendChild(input);        // 添加临时实例
    input.select();                         // 选择实例内容
    document.execCommand("Copy");           // 执行复制
    document.body.removeChild(input);       // 删除临时实例
    console.log(`copy ok`);
}

相关文章

网友评论

    本文标题:Creator中复制的操作

    本文链接:https://www.haomeiwen.com/subject/atvyxktx.html