createCopy(id) {
var text = document.getElementById(id);
if (document.body.createTextRange) {
var range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
} else {
alert("none");
}
document.execCommand('Copy','false',null);
}
可用Ctrl+V执行复制操作 非常实用!!!