<el-button :icon="DocumentCopy" @click="copy">
复制
</el-button>
const copy = () => {
const text = `
app_secret:${data.clientSecret}
密钥:${data.sign}
私钥:${data.privateKey}
`
const input = document.createElement('input');
input.setAttribute('readonly', 'readonly');
input.setAttribute('value', text);
document.body.appendChild(input);
input.select();
if (document.execCommand('copy')) {
document.execCommand('copy');
ElMessage.success('复制成功');
}
document.body.removeChild(input);
};