<button @click="copyUrl">复制url</button>
//js copyUrl() { const input = document.createElement('input') document.body.appendChild(input) input.setAttribute('value',"这里能够写变量或者要复制的字符串内容") input.select() if (document.execCommand('copy')) { document.execCommand('copy') } document.body.removeChild(input)