<code><script type="text/template" id="item-template">
<div class="view">
<input type="checkbox" class="toggle" {{ completed ? "checked" : "" }} >
<label for="">{{title}}</label>
<input type="button" class="destroy" />
</div>
<input type="button" value="{{title}}" class="edit">
</script>
里面的{{ completed ? "checked" : "" }}貌似解析不了,请问是该模板语言不支持吗?(mustache.js)
抱歉,问题解决了,是我把mustache当成了后端的smarty语言,`{{#completed}}checked{{/completed}}`这样就可以了,completed为真就显示,否则不输出</code><code><script type="text/template" id="item-template">
<div class="view">
<input type="checkbox" class="toggle" {{ completed ? "checked" : "" }} >
<label for="">{{title}}</label>
<input type="button" class="destroy" />
</div>
<input type="button" value="{{title}}" class="edit">
</script>
里面的{{ completed ? "checked" : "" }}貌似解析不了,请问是该模板语言不支持吗?(mustache.js)
抱歉,问题解决了,是我把mustache当成了后端的smarty语言,`{{#completed}}checked{{/completed}}`这样就可以了,completed为真就显示,否则不输出</code>
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号