It seems rather odd that I can't figure how to do this in mustache.(似乎很奇怪,我无法想象如何在胡子中做到这一点。)
Is it supported?(是否支持?)
This is my sad attempt at trying:(这是我尝试的悲伤尝试:)
{{#author}}
{{#avatar}}
<img src="{{avatar}}"/>
{{/avatar}}
{{#!avatar}}
<img src="/images/default_avatar.png" height="75" width="75" />
{{/avatar}}
{{/author}}
This obviously isn't right, but the documentation doesn't mention anything like this.(这显然是不对的,但文档中没有提到这样的事情。) The word "else" isn't even mentioned :((甚至没有提到“其他”这个词:()
Also, why is mustache designed this way?(另外,为什么胡子是这样设计的?) Is this sort of thing considered bad?(这种事情被认为是坏事吗?) Is it trying to force me to set the default value in the model itself?(它是否试图强迫我在模型中设置默认值?) What about the cases where that isn't possible?(那些不可能的情况怎么样?)
ask by egervari translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…