Thymeleaf, th문법

kangsun lee·2023년 3월 8일
0

Spring

목록 보기
24/24

th:remove="tag"
th 문법을 추가하기 위해 div 태그를 만들었을 때 화면상에 없애고 싶을 때 추가해준다.

th:each="option, status : ${order.options}"

th:classappend="${status.last and #lists.size(order.attrs) == 0 ? 'no_line res_pb0' : ''}">

th 변수에 ,status를 추가해주면 index값을 가져올 수 있고, .last를 이용해서 마지막 값을 불러올 수 있다.

th:classappend
< div class=" 여기에 추가 ~~" >
div class 태그안에 텍스트를 추가해줄 수 있음.

#lists.size()
리스트로 담겨져 있는 데이터의 길이를 알 수 있다.

profile
코딩 공부 💻

0개의 댓글