(Layui 表格排坑) Cannot create property 'key' on boolean 'true'

今天用Layui开发的时候突然遇到一个表格渲染出错的问题。js报错 Uncaught TypeError: Cannot create property 'key' on boolean 'true' , 源代码压缩后我是看不懂,后面搜社区的时候找到问题所在,文档 cols: [] 不行 用示例的 [[ ]] 解决。 权引用自 Fly社区

例子

var tableIn = table.render({
···省略···
cols: [
{field: 'id', title: '{:lang("id")}', width: 80, fixed: true},
{field: 'title', title: '公告名称', width: 400,templet: '#title'},
],
···省略···
});
//改成
var tableIn = table.render({
···省略···
cols: [[
{field: 'id', title: '{:lang("id")}', width: 80, fixed: true},
{field: 'title', title: '公告名称', width: 400,templet: '#title'},
]],
···省略···
});
本作品采用《CC 协议》,转载必须注明作者和本文链接
困困熊
Meriodas
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!