在你点击的元素上加一个空点击事件:οnclick=""。因为ios不单纯支持on
<span id='logistics_no' style='color:#fff'>复制人内内容</span>
<span class="sccn-list-share" data-clipboard-target="#logistics_no" οnclick="">复制</span>
//复制
function clipboard()
{
var clipboard = new ClipboardJS('.sccn-list-share');
clipboard.on('success', function(e) {
//console.info('Action:', e.action);
//console.info('Text:', e.text);
//console.info('Trigger:', e.trigger);
e.clearSelection();
//提示
layer.open({
content: '复制成功'
,skin: 'msg'
,time: 1
});
});
clipboard.on('error', function(e) {
//console.error('Action:', e.action);
//console.error('Trigger:', e.trigger);
});
}
来源:CSDN
作者:happylifeng
链接:https://blog.csdn.net/happylifeng/article/details/84924854