页面引入clipboard.js,html代码有对应的标签,其他js写法如下:
var clipboard = new ClipboardJS("#fz", { text: function () { return "要复制的内容"; } }); clipboard.on('success', function (e) { layer.msg("复制成功"); }); clipboard.on('error', function (e) { layer.msg(e); });
页面引入clipboard.js,html代码有对应的标签,其他js写法如下:
var clipboard = new ClipboardJS("#fz", { text: function () { return "要复制的内容"; } }); clipboard.on('success', function (e) { layer.msg("复制成功"); }); clipboard.on('error', function (e) { layer.msg(e); });