1. 程式人生 > >layui table 中顯示圖片

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>' }

        }
    ]]
});