- PC:vue+element-ui 需实现复制功能
// 复制内容
export function copy(value) {
let input = document.createElement('input');
input.value = value;
document.body.appendChild(input);
input.select();
document.execCommand('Copy');
this.msgSuccess('复制成功!');
input.remove();
}
- 小程序复制
wx.setClipboardData({
data: e.detail,
success() {
wx.showToast({
title: '复制成功',
})
}
})