1. 添加button按钮

<a-button type="primary" size="small" @click="onCopy(viewDetailForm.val)">复制</a-button>

2. method中添加copy方法

onCopy(certB64){
  let oInput = document.createElement('input')
  oInput.value = certB64;
  document.body.appendChild(oInput)
  oInput.select() // 选择对象
  document.execCommand("Copy") // 执行浏览器复制命令
  this.$message.success("复制成功");
  oInput.remove()
}

以上代码,支持Element-UI,Ant Design两种前端UI框架。

相关文章:

  • 2022-12-23
  • 2021-09-13
  • 2021-10-25
  • 2022-01-27
  • 2021-06-29
  • 2021-07-26
  • 2021-12-04
  • 2021-10-11
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-08-07
  • 2022-12-23
相关资源
相似解决方案