Thymeleaf使用easy-ui出现脚本无法解析的问题

问题来源

今天用SpringBoot中的Thymeleaf查询数据库中数据并进行分页,为了方便使用了easyui的datagrid,并通过脚本创建数据网格,但是一直报一个错误:无法解析datagrid的脚本语言。经过查询资料,解决方案如下:

原脚本如下:

<link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="/easyui/demo.css">
    <script type="text/javascript" src="/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/easyui/jquery.easyui.min.js"></script>
    <script>
        $(function(){
            $(function(){
                $('#usershow').datagrid({
                    url: 'user',
                    rownumbers:true,
                    pagination:true,
                    pageSize:2,
                    pageList:[2,4],
                    columns: [[
                        {field: 'uname', title: '用户名', width: 200,align:'center'},
                        {field: 'pwd',title: '密码',width: 200,align:'center'},
                        {field: 'phone', title: '手机号', width: 200,align:'center'}
                    ]]
                });
            });
        });

    </script>

问题如下:

There was an unexpected error (type=Internal Server Error, status=500).
Could not parse as expression:

 " {field: 'uname', title: '用户名', width: 200,align:'center'}, {field: 'pwd',title: '密码',width: 200,align:'center'}, {field: 'phone', title: '手机号', width: 200,align:'center'} " (template: "page" - line 20, col 32)

问题解决:

在中加一个th:inline="none"就可以解决了

在这里插入图片描述

虽然解决了,但还是不明白是为啥,若有大佬路过望解析。

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值