0
내가 밑줄 템플릿에 루프에서 if 문이를 추가하기 위해 노력하고있어 경우 :밑줄 루프 내에서 문이
<% _.each(looks, function(listItem, index){ %>
<% if(_.contains(firstBatch, listItem.id)){ %>
<% if (index % 2 == 0) { %>
<div class="large-6 column overlay-col">
<% } else { %>
<div class=" column overlay-col">
<% } % %>
<% } %>
<% }) %>
기본적으로는 지수가 짝수 인 경우 감지하지만 나는이 콘솔 오류가 발생합니다 :
SyntaxError: missing : after property id
if (index % 2 === 0) {
코드에 어떤 문제가 있습니까?
<% } % %>
여분 %가 기능 :
덕분에, 저 바보! – user1937021