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.
在haml中,我想显示5 / 174. 分子,正斜杠,分母。
5 / 174
= @numerator / = denominator
我的解决方法:
= @numerator - slash = "/" = slash = denominator
我只会使用插值#{}来做这样的事情:
#{}
#{@numerator} / #{denominator}
(注意你一开始不需要=)。
=
如果你真的想用/字符(或任何其他特殊字符)在 Haml 中开始一行,你可以使用\例如
/
\
= @numerator \/ = denominator