Thymeleaf报错org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: “***”
问题描述
在使用layui初始化table的时候,报了这个错
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "
{field: 'name', title: '角色名称', align: 'center'},
{field: 'remark', title: '角色备注', align: 'center'},
{field: 'createTime', title: '创建时间', align: 'center'},
{fixed: 'right', title: '操作', toolbar: '#roleRowBar', align: 'center', width: 280}
" (template: "system/role/roleManager" - line 133, col 21)
来看看我初始化表头是怎么写的:
cols: [[
{field: 'name', title: '角色名称', align: 'center'},
{field: 'remark', title: '角色备注', align: 'center'},
{field: 'createTime', title: '创建时间', align: 'center'},
{fixed: 'right', title: '操作', toolbar: '#roleRowBar', align: 'center', width: 280}
]],
感觉和官方文档写的没啥区别啊,为啥就会报错呢~~~
问题解决
问题解决,都是在一个偶然的情况下,乱搞把[[和]]之间加个空格,如[ [。这个问题就莫名其妙的解决了!?
cols: [ [
{field: 'name', title: '角色名称', align: 'center'},
{field: 'remark', title: '角色备注', align: 'center'},
{field: 'createTime', title: '创建时间', align: 'center'},
{fixed: 'right', title: '操作', toolbar: '#roleRowBar', align: 'center', width: 280}
] ]
就很离谱😵

编程到最后可能编的都是玄学了吧😆
如果有大佬知道为原因的可以评论告诉小弟哟~~~
799

被折叠的 条评论
为什么被折叠?



