flask 与layui冲突
代码:
{field: 'img3', title: '03', width:cell_w,style:cell_h,event:'setBackground',templet:'<div><img src="{{ d.img3 }}"><br/><lable>老鼠图片</lable></div>'}
{{}}是flask遍历后台变量的语法
layui想用{{ d.img3 }} 读取列数据,结果flask优先了,layui读取不到数据:
解决方法:
{field: 'img6', title: '06', width:cell_w,style:cell_h,event:'setBackground',templet: function(res){ return '<div><img src="'+ res.img6 +'"><br/><lable>老鼠图片</lable></div>' }}