<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)