<div
                    class="format-txt"
                    @dblclick.stop="dbCopy(scope.row)"
                    slot-scope="scope"
                >
                    <el-popover
                        placement="top-start"
                        width="280"
                        trigger="hover"
                        :content="smsCont(scope.row)"
                    >
                        <span
                            slot="reference"
                            @onselectstart="return false;"
                            style="-moz-user-select: none"
                            class="not-select"
                            >{{ smsCont(scope.row) }}</span
                        >
                    </el-popover>
                </div>
 
 
 
 
dbCopy(scope) {
            let cont = `【${scope.smsSign}】${scope.smsContent}`;
            let ipt = document.querySelector("#ipt");
            ipt.style.dislpay = "block";
            ipt.setAttribute("value", cont);
            ipt.select(); // 选择对象
            document.execCommand("Copy");
            this.$message.success("复制成功");
            ipt.setAttribute("value", "");
            // ipt.style.dislpay = "none";
        },
 
   <input  />
#ipt {
    position: absolute;
    left: 0;
    top: 10000px;
    // visibility: hidden;
    z-index: -9999;
    // display: none;
}
 
.not-select {
    user-select: none;
}

相关文章:

  • 2021-08-06
  • 2021-11-08
  • 2022-12-23
  • 2021-09-30
  • 2022-12-23
  • 2021-08-23
猜你喜欢
  • 2022-01-03
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2021-10-04
  • 2021-11-22
相关资源
相似解决方案