开发者

Template formatting

开发者 https://www.devze.com 2023-03-04 08:27 出处:网络
I\'m trying to figure out how I can format a value with jquery templates. One of the values is a bool 开发者_运维百科which I would like to convert to a string. I tried:

I'm trying to figure out how I can format a value with jquery templates.

One of the values is a bool 开发者_运维百科which I would like to convert to a string. I tried:

{IsVisible?'x':'-'}

which didn't work. How can I do it?


That should work fine (provided it's prefixed with a $):

${IsVisible ? 'x' : '-'}

Working Demo.

0

精彩评论

暂无评论...
验证码 换一张
取 消