<div>
<p>邀請碼</p>
//
<p id="inviteCode" class="inviteCode">{{invite_code}}</p>
<input id="inviteCode" class="inviteCode" type="text" />
<p class="copy">複製</p>
</div>瀏覽器
copy() {app
var Url2 = this.invite_code; this
//var oInput = document.createElement("input"); code
var oInput = document.getElementById("inviteCode"); 對象
//oInput.value = Url2; get
// document.body.appendChild(oInput); input
oInput.select();// 選擇對象it
//document.execCommand("Cut","false",null);// 執行瀏覽器剪切命令console
document.execCommand("Copy");// 執行瀏覽器複製命令class
//oInput.className = "oInput";
//oInput.style.display = "none";
alert("複製成功");
//console.log(document.execCommand("Copy"))
},