标签:join only cti 命令 style mobile this script rip
getDateStr (seconds) { let date = new Date(seconds) let year = date.getFullYear() let month = date.getMonth() + 1 let day = date.getDate() let hour = date.getHours() < 10 ? ‘0‘ + date.getHours() : date.getHours() let minute = date.getMinutes() < 10 ? ‘0‘ + date.getMinutes() : date.getMinutes() let second = date.getSeconds() < 10 ? ‘0‘ + date.getSeconds() : date.getSeconds() let currentTime = year + ‘-‘ + month + ‘-‘ + day + ‘ ‘ + hour + ‘:‘ + minute + ‘:‘ + second return currentTime }
getDateStr(1553161922000) // 2019-03-21 17:52:02
<el-input :value="`${activityHost}/mobile/activity/join?id=${activityId}`" :readonly="true" ref="activeUrl"> <template slot="append"> <el-button type="text" style="padding: 10px 20px;" @click="copyActiveUrl">复制</el-button> </template> </el-input>
copyActiveUrl() {
var activeUrl = this.$refs.activeUrl.$refs.input // 要操作的Dom
activeUrl.select()
document.execCommand("Copy");
}
或者:
<
script
type
=
"text/javascript"
>
function copy()
{
var url=document.getElementById("textID"); // 获取要操作的DOM
Url2.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
alert("已复制好,可贴粘。");
}
</
script
>
<
textarea
cols
=
"20"
rows
=
"10"
id
=
"textID"
>用户定义的代码区域</
textarea
>
<
input
type
=
"button"
onClick
=
"copy()"
value
=
"点击复制代码"
/>
标签:join only cti 命令 style mobile this script rip
原文地址:https://www.cnblogs.com/linjiu0505/p/10579082.html