JavaScript点击复制

2020-06-01  本文已影响0人  coderfl
<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()
      },
上一篇下一篇

猜你喜欢

热点阅读