handlebars库是另外一个模板引擎,他继承mustache(胡子),感觉没有jade(珠宝)好听,他不允许在模板中写很多JavaScript的逻辑。这有助于保持模板的简洁。

handlebars语法

handlebars需要严格的书写html的标签!!!。。。光是这一点,我感觉就没有jade好用啊。

变量

demo

<h1>{{title}}</h1>
<h1>{{body}}</h1>

数据:

{
	title:"node js handlebars",
	body:"handlebars is another engine"
}

渲染html

<h1>handlebars</h1>
<h1>handlebars is another engine</h1>

  

相关文章:

  • 2022-01-25
  • 2022-12-23
  • 2021-11-24
  • 2021-07-20
  • 2021-06-27
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
猜你喜欢
  • 2022-02-05
  • 2021-10-26
  • 2021-11-17
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
相关资源
相似解决方案