Thymeleaf获取model中的值和JS获取Model中的数据

更新时间:2023-05-03 19:46:34 阅读: 评论:0

Thymeleaf获取model中的值和JS获取Model中的数据
json
{
"id": 82,
"workNumber": "M202105241431",
"issueNumber": "202105241431",
"workName": "99999",
"beginTime": "2021-05-24 14:31:00",
"endTime": "2021-05-24 14:31:00",
"propor": "9999999",
"applyTime": "2021-05-24 14:31:00",
"type": 1,
"fenceId": "202105241537",
"ids": null,
"deviceIds": null,
"contractorId": null,
"pageBean": {
"page": 1,
"rows": 1,
"total": 0,
"pagination": fal
},
"organId": 0,
"fence": {
"fid": "c400950fbbcc46e0aad3ab2c1527f4bf",
"name": null,
"polygon": "POLYGON((108.609408309177 21.7154145609395,108.609416256597 21.7154225081542,108.609424203689 21.7154145609395,108.60940        "geom": null,
"placeId": "97",
"buildingId": 1,
"floorId": "01",
"橄榄油食用方法 lonLats": [
[108.609408309177, 21.7154145609395],
[108.609416256597, 21.7154225081542],
[108.609424203689, 21.7154145609395],
[108.609408309177, 21.7154145609395]
]
}
};
1:Thymeleaf 获取model中的值
访问model中的数据
//通过“${}”访问model中的属性
<input type="text" id="id" hidden="true关于华罗庚的故事 " th:value="${workDetail.id}" /&消防知识安全常识 gt;
<input type="text" th:value="${workDetail.workNumber}" id="workNumber"></input>
<input type="text" th:value="${workDetail.issueNumber}" id="issueNumber">
<input type="text" th:value="${workDetail.workName}" id="workName"></input>
2:JS获取Model中的数据
<script th:inline="javascript">
var a = [[${workDetail}]];
var b = [[${workDetail.id}]];
var c = [[${workDetail.workNumber}]];
var d = [[${wo请财神 rkDetail.issueNumber}]];
var e = [[${workDetail.workName}]];
var f = [[${workDetail.fence.lonLats}]];
</script>
var a = {"id":82,"workNumber":"M202105241431","issueNumber":"202105241431","workName":"99999","beginTime":"2021-05-24 14:31:00","endTime":"2
var b = 82;
var c = "M20心情焦虑怎么办 2105241431";
var d = "202105241431";
var e = "99999";
var f = [[108.609408309177,21.715学习经验 4145609395],[108.609416256597,21.712006年属什么 5422508属狗的是哪年出生的 1542],[108.609424203689,21.7154145609395],葡萄用英语怎么读 [108.609408309177,21        var g = '[[108.609408309177,21.7154145609395],[108.609416256597,21.7154225081542],[108.609424203689,21.7154145609395],[108.609408309177,2

本文发布于:2023-05-03 19:46:34,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/854514.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:数据   访问   获取   属性
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图