我如何在胡须中利用变量 [英] How do i capitalize a variable in mustache
本文介绍了我如何在胡须中利用变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的胡子模板中有这个变量,名为type,我想用title case大写大写的值,这可能吗?考虑到该类型不是网页上显示的内容,它会存储一个值。
{{type}}
span 中并使用CSS。
CSS
.capitalize {
text-transform:capitalize;
模板
< span class =capitalize> {{type}}< / span>
I have this variable in my mustache template called type, i want to capitalise the value of type using title case, is this possible ? taking into consideration that type is not what is displayed on the web page, it stores a value.
{{type}}
解决方案
You can wrap it in a span
and use CSS.
CSS
.capitalize {
text-transform: capitalize;
}
Template
<span class="capitalize">{{type}}</span>
这篇关于我如何在胡须中利用变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文