layui table 中显示图片

图示:


vm.layui.tableIns = table.render({
    elem: '#layuiTable',
    url: baseURL + 'iotassert/iotassertsensortype/list',
    cellMinWidth: 95,
    page: true,
    height: "full-110",
    limits: [10, 20, 40, 100],
    limit: 20,
    id: "layuiTable",
    cols: [[
        {type: "checkbox", fixed: "left", width: 50},
        {type: "numbers", title: "序号", fixed: "left", width: 50},
        {field: 'sensorType', title: '编号', align: "center", width: 100, sort: true, templet: function (d) {
            return "<a href='#' onclick='vm.update(\"" + d.sensorType + "\");'>" + d.sensorType + "</a>";
        }},
        {field: 'assertName', title: '设备类型', align: "center", width: 130, sort: true},
        {field: 'assertCode', title: '设备代码', align: "center", width: 100, sort: true},
        {field: 'parameterCode', title: '参数代码', align: "center", width: 100, sort: true},
        {field: 'chartName', title: '图表类型', align: "left", width: 160, sort: false},
        {field: 'explain', title: '计量单位', align: "center", width: 100, sort: false},
        {field: 'description', title: '参数描述', align: "left", sort: false},
        {field: 'photo', title: '图标', align: "left", sort: false,
            templet:function (d) { return '<div><img src='+d.photo+'></div>' }

        }
    ]]
});

猜你喜欢

转载自blog.csdn.net/sky_315/article/details/83146403