Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 erb 文件中,我可以执行类似的操作
<tr class="<%= cycle('list_line_odd', 'list_line_even') %>">
这条线在苗条文件中的外观如何?谢谢。
或者:
tr[class=cycle('list_line_odd', 'list_line_even')]
或者
tr class=cycle('list_line_odd', 'list_line_even')
tr[class="#{cycle('list_line_odd', 'list_line_even')}"]