How do I lowercase a field using Handlebars.js?

前端 未结 5 1061
我寻月下人不归
我寻月下人不归 2021-02-01 14:27

I want to do something like this:

{{user.name.toLowerCase()}}

but I get this error:

Error: Parse error on line X:
...tatus {{us         


        
5条回答
  •  有刺的猬
    2021-02-01 14:55

    If you're just trying to display some text as lowercased in HTML (regardless of whether or not it's generated by handlebars), you can use CSS and apply text-transform like so:

    .css-class-here {
        text-transform: lowercase;
    }
    

提交回复
热议问题