Commit b5fd127a authored by zhengke's avatar zhengke

增加复制

parent 0e964435
......@@ -11,8 +11,8 @@
<div class="content">
<div>
<el-alert title="员工登录入口链接:" :closable='false' type="info" style="margin-bottom:20px;">
<span>http://wx.weibaoge.cn/web/index.php?r=admin/passport/login&mall_id=MTI4NQ==</span>
<el-button size="mini" style="margin-left:20px;">复制链接</el-button>
<span id="my_Link">http://wx.weibaoge.cn/web/index.php?r=admin/passport/login&mall_id=MTI4NQ==</span>
<el-button size="mini" style="margin-left:20px;" @click="copyCode()">复制链接</el-button>
</el-alert>
<div class="searchInput">
<el-input style="display:inline-block;width:225px;height:30px" placeholder="请输入用户昵称"
......@@ -228,8 +228,17 @@
let checkedCount = value.length;
this.checkAll = checkedCount === this.cities.length;
this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
},
//点击复制
copyCode(){
var copycode = document.getElementById("my_Link").innerHTML;
    var input = document.createElement("input");   // 直接构建input
    input.value = copycode;  // 设置内容
    document.body.appendChild(input);    // 添加临时实例
    input.select();   // 选择实例内容
    document.execCommand("Copy");   // 执行复制
    document.body.removeChild(input); // 删除临时实例
}
},
mounted() {
//this.getList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment