本文介绍了检查小胡子js参数是否为特定值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在小胡子js中检查特定值,例如{{name}} == "James"?

Is it possible to check in mustache js for a specific value like {{name}} == "James" ?

数据:

json: {
    name: "James"
}

HTML:

{{name}} //Will give me James as output
{{name == "James" }} //Is it possible to check specific value?

推荐答案

否.胡须背后的想法是,它是一种无逻辑的模板语法.因此,不,这样的逻辑是不可能的.

No. The idea behind mustache is that it is a logic-less templating syntax. So, no, such a logic is not possible.

这篇关于检查小胡子js参数是否为特定值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 11:22
查看更多