美文网首页
JavaScript点击复制

JavaScript点击复制

作者: coderfl | 来源:发表于2020-06-01 21:10 被阅读0次
    <el-button type="primary" plain @click="copyText(link)">复制内链</el-button>
    
    // 点击复制
          copyText(v) {
            let oInput = document.createElement('input')
            oInput.value = v
            document.body.appendChild(oInput)
            oInput.select()
            document.execCommand("Copy")
            this.$message.success('复制成功')
            oInput.remove()
          },
    

    相关文章

      网友评论

          本文标题:JavaScript点击复制

          本文链接:https://www.haomeiwen.com/subject/wqkezhtx.html