1、将下面代码放在backend-init.js文件 $('body').on('click', '[data-tips-image]', function() { var img = new Image(); var imgWidth = this.getAttribute('data-width') || '480px'; img.onload = function() { var $content = $(img).appendTo('body').css({ background: '#fff', width: imgWidth, height: 'auto' }); Layer.open({ type: 1, area: imgWidth, title: false, closeBtn: 1, skin: 'layui-layer-nobg', shadeClose: true, content: $content, end: function() { $(img).remove(); }, success: function() {} }); }; img.onerror = function(e) {}; img.src = this.getAttribute('data-tips-image') || this.src; }); ![][1] 2、修改require-table.js,添加data-tips-image ![][2] [1]: https://gitee.com/pgmerz/blogi/raw/master/art/fast3.png#vwid=1054&vhei=572 [2]: https://gitee.com/pgmerz/blogi/raw/master/art/fast4.png#vwid=1465&vhei=560 Last modification:November 23rd, 2020 at 02:07 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat