Themeleaf模板中在JS中遍历后台传过来的list,使用toastr插件做弹窗处理
<script th:inline="javascript">
toastr.options = {
"closeButton": true,
"debug": false,
"positionClass": "toast-bottom-right",
"onclick": null,
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "50000",
"extendedTimeOut": "1000",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
/*<![CDATA[*/
/*[# th:each="equipment : ${list}"]*/
toastr.warning('编号:'+[[${equipment['name']}]]+',设备名称:'+[[${equipment['number']}]]+
',下次维护时间:'+[[${#dates.format(equipment.nextMaintenanceTime, 'yyyy-MM-dd')}]], "设备维护提醒");
var name = [[${equipment['name']}]]
var number = [[${equipment['number']}]]
/*[/]*/
/*]]>*/
</script>