layui comfirm 监听点击确定、取消、“X”关闭按钮
layer.confirm('数据已存在,是否继续', { offset: '200px' , cancel: function (index, layero) { console.log('点击X按钮'); layer.close(index); } }, function (index) { console.log('点击确定按钮'); layer.close(index); } , function (index) { console.log('点击取消按钮'); layer.close(index); });