How do i capitalize a variable in mustache

喜夏-厌秋 提交于 2019-12-10 10:37:07

问题


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}}


回答1:


You can wrap it in a span and use CSS.

CSS

.capitalize {
    text-transform: capitalize;
}

Template

<span class="capitalize">{{type}}</span>


来源:https://stackoverflow.com/questions/32656158/how-do-i-capitalize-a-variable-in-mustache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!