2

#yyds干货盘点# 【React工作记录六十七】前端实现复制文字操作

 1 year ago
source link: https://blog.51cto.com/u_14476028/5429640
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

#yyds干货盘点# 【React工作记录六十七】前端实现复制文字操作

原创

前端歌谣 2022-06-30 10:34:14 ©著作权

文章标签 前端 文章分类 JavaScript 前端开发 yyds干货盘点 阅读数161

我是歌谣 我有个兄弟 巅峰的时候排名c站总榜19 叫前端小歌谣 曾经我花了三年的时间创作了他 现在我要用五年的时间超越他 今天又是接近兄弟的一天人生难免坎坷 大不了从头再来 歌谣的意志是永恒的 放弃很容易 但是坚持一定很酷

前端实现复制文字操作

#yyds干货盘点# 【React工作记录六十七】前端实现复制文字操作_前端

​编辑

copyTitle(certB64) {
let oInput = document.createElement('input');
oInput.value = certB64;
document.body.appendChild(oInput);
oInput.select(); // 选择对象
var successful = document.execCommand('Copy'); // 执行 copy 操作
if (successful) {
message.success('复制成功!');
} else {
message.warning('复制失败,请手动复制!');
}
oInput.remove();
}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK