我有這樣的玉snippt:如何將複雜的對象數組傳遞給Jade模板?
div.comment_list
- var clist = comment_list
each comment in clist
div.comment
div.comment_detail
span.commentator comment.commentator
span.comment_time comment.comment_time
span.comment_content comment.comment_content
的comment_list
是我進入玉模板。
的問題是: 每個數組元素comment
由複合對象,因爲您看見其中,, 具有commentator
,comment_time
,和comment_content
。
然而,玉不能識別這個事實,它只是輸出:comment.commentator
comment.comment_time
,comment.comment_content
vebatim。
那麼如何解決這個問題呢?
謝謝!好答案! – larmbr 2013-05-11 02:45:00