直接上代码
返回的json格式
{ "code":"0", "count":"1", "data":[ { "goodsId":"405e0565-5416-43b5-b684-593576560db0", "goodsImg":"ad87f66eaec5de95b51ef46f4158d15e.jpg", "goodsName":"1", "goodsPrice":21.1, "goodsTypleName":"一般食品", "gooodsNum":12 } ], "msg":true }
layui表格中显示图片
, {field: 'goodsImg', title: '物品图片', 200,templet:'<div><img src="/statics/images/{{d.goodsImg}}"></div>'}
templet是自定义控件,d是我返回的数据data的信息,【必须是d,这个不能改】,goodsImg是我图片那一栏信息