如何在Handlebar模板中使用注释? [英] How to use comments in Handlebar templates?

查看:82
本文介绍了如何在Handlebar模板中使用注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Handlebar.js作为我的模板引擎。现在我想注释掉我的车把模板中的一些块。但后来我意识到,车把不会忽略车把注释块内的表情。任何解决方法?

I am using Handlebar.js as my templating engine. Now I want to comment out some of the blocks in my handlebar templates. But then I realized that Handlebar doesn't ignore the expressions inside the Handlebar comment block. Any workaround for this?

推荐答案

最新版本的Handlebars具有块注释支持:

The newest version of Handlebars has block comments support :

{{!-- {{commented expressions}} --}}

https://github.com/wycats/handlebars.js / commit / a927a9b0adc39660f0794b9b210c9db2f7ddecd9

这篇关于如何在Handlebar模板中使用注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆