0
我不知道我怎樣才能使這個代碼在我看來條件 - 輸出,如果有一個評論,但如果沒有一個評論,不輸出空<p class="comment"></p>
Grails的條件HTML
<p class="comment">
${progressItem.comment}
</p>
我不知道我怎樣才能使這個代碼在我看來條件 - 輸出,如果有一個評論,但如果沒有一個評論,不輸出空<p class="comment"></p>
Grails的條件HTML
<p class="comment">
${progressItem.comment}
</p>
<g:if test="${(progressItem?.comment?.size() > 0)}">
<p class="comment">
${progressItem.comment}
</p>
</g:if>
它沒有爲我工作... –
什麼沒有工作呢? –
評論完全沒有顯示。對不起,我沒有包括那 –