1.在表格里增加复制按钮
//address代表复制的内容值
{field:'address',title: __('复制'), operate: false,formatter: function(value,row,index){
return '<button value="'+value+'" class="btn btn-success copy-link" title="Copy Link"><i class="fa fa-copy"></i></button>'
}},
2.执行点击按钮复制
$(document).on("click",".copy-link",function(){
var url = $(this).val();
var oInput = document.createElement('input');
oInput.value = url;
document.body.appendChild(oInput);
oInput.select(); // 进择对家
document.execCommand("Copy"); // 执行浏览器复制命分
oInput.className = 'oInput';
oInput.style.display= 'none';
Layer.msg('复制链接成功');
// 为表格绑定事件
});