<div
class="text-wrapper"
style="white-space: pre-wrap; widht: 100%; height: 100%"
v-html="look2"
v-if="isShow2"
id="text2"
>
{{ look2 }}
<el-input v-model="look2" id="input2"> </el-input>
</div>
</div>
<div class="word-button">
<el-button
@click="copyText()"
class="text-button"
type="primary"
size="mini"
>复制量刑信息内容</el-button
>
copyText() {
if (this.isShow1 == true && this.isShow2 == false) {
console.log(1);
let text = document.getElementById("text").innerText;
let input = document.createElement("input");
input.value = text;
document.body.appendChild(input);
input.select();
document.execCommand("Copy");
document.body.removeChild(input);
} else if (this.isShow1 == false && this.isShow2 == true) {
console.log(2);
let text = document.getElementById("text2").innerText;
let input2 = document.createElement("input2");
input2.value = text;
document.body.appendChild(input2);
input2.select();
document.execCommand("Copy");
document.body.removeChild(input2);
}
this.$message({
message: "复制成功",
type: "success",
});
},