// 动态创建 input 元素
var aux = document.createElement("input");
// 获得需要复制的内容
aux.setAttribute("value", this.datasy.keyWord);
//aux.innerHTML=this.datasy.keyWord;
// 添加到 DOM 元素中
document.body.appendChild(aux);
// 执行选中
// 注意: 只有 input 和 textarea 可以执行 select() 方法.
aux.select();
// 获得选中的内容
var content = window.getSelection().toString();
// 执行复制命令
document.execCommand("copy");
// 将 input 元素移除
document.body.removeChild(aux);
Toast('复制成功');
05-11 20:13