layui table表格中点击图片放大

   {field:'plateNoPicUri', title: '图片' ,width:"10%" ,templet:function(data){
          if("" == data.plateNoPicUri || null == data.plateNoPicUri)
              return "";
          var subStr = data.plateNoPicUri.substr(0,4);
          if("http" == subStr)
              return '<img onclick="showimg(this)" width="200px" src="' + data.plateNoPicUri + '"/>';
          return "获取图片失败";
     }}

  //点解图片放大
  window.showimg = function (t) {
      layer.open({
          type: 1,
          title: false,
          closeBtn: 0,
          area: '716px',
          skin: 'layui-layer-nobg',
          shadeClose: true,
          content: '<img style="display: inline-block; width: 100%; height: 100%;" src="' + t.src + '">'
      });
  } 
posted @ 2023-04-24 17:06  xingduo  阅读(471)  评论(0编辑  收藏  举报