javascript - 是否可以在 underscore.js 或 lodash 模板中添加非 html 注释?

标签 javascript underscore.js lodash

是否可以在 underscore.js 或 lodash 中添加非 html 注释?

类似于:

<%-- We do this here because... %>

这样注释就不会出现在生成的 html 代码中吗?

如果我写:

<!-- We do this here because... -->

评论位于生成的 html 中。

谢谢。

最佳答案

这是一个客户端模板,您仍然会看到评论,但不会重复等...

<%
// comments go here
%>

关于javascript - 是否可以在 underscore.js 或 lodash 模板中添加非 html 注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15023513/

相关文章:

javascript - 使用 Underscore.js 进行不区分大小写的数组过滤

javascript - _.chain - 下划线 JS

javascript - Lodash - 获取数组

javascript - lodash - 通过提供两个要在其中查找的值来查找所有对象

javascript - 有没有更好的方法在 javascript 的 forEach 循环中填充数组?

javascript - CSS - 关闭 Canvas 问题

javascript - 我如何在 Next.js 中删除 ID 为 ="__next"的 div

javascript - 使用 2 个条件对 JS 对象数组进行排序

javascript - 在WordPress的Youtube Player中包含跳至特定时间的链接

javascript - 如何使用 lodash 对 javascript 对象数组进行分组