<div v-show="CopyDataIndexshow" style="padding:20px;position: absolute;right: -9999px;text-indent: -9999px;width: 0;height: 0;font-size: 0;" :id="'CopyDataIndex'+i" v-html="item"> </div>
var node = document.getElementById("CopyDataIndex"+ this.CopyDataIndexadd);
var range; this.$nextTick(()=>{ if (document.body.createTextRange) { // IE // 用于表示文档中特定的一段文本,例如在按住鼠标选中页面上的内容时,创建出的就是一个较为典型的 TextRange。 range = document.body.createTextRange(); range.moveToElementText(node); //使区域包含指定元素的文本。只能用于 Element 对象。 range.select(); document.execCommand('copy'); } else if (window.getSelection) { // Selection 对象表示用户选择的文本范围或插入符号的当前位置。它代表页面中的文本选区,可能横跨多个元素。 var selection = window.getSelection(); range = document.createRange(); range.selectNode