前端笔记-thymeleaf获取及回显input标签type=time
生活随笔
收集整理的這篇文章主要介紹了
前端笔记-thymeleaf获取及回显input标签type=time
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前端效果如下:
設置的時候就是這樣的
前端代碼如下:
<div class="form-group"><label>開課時間</label><input class="form-control" type="time"name="beginTime"th:value="${people!=null}?${#dates.format(people.beginTime, 'HH:mm')}" /> </div>從中可以看到,如果people為null就不設置數據,當有people時格式更新為‘HH:mm’的形式
?
這里beginTime直接是Datetime類型
這里獲取前端數據為String類型,將它轉為date類型或者datetime類型即可:
@RequestPara("beginTime") String beginTime
?
總結
以上是生活随笔為你收集整理的前端笔记-thymeleaf获取及回显input标签type=time的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Redis工作笔记-List类型
- 下一篇: 前端笔记-利用thymeleaf隐藏显示