1.类名和ID名
a.button
a(class="button")
a#button
a(id = "button")
编译后:<a class="button"></a>
<a id="button"></a>
如果前面没指定标签名,则默认div
2.属性
用()包裹,属性值之间用逗号隔开。可实现根据条件设置属性的语法形式
&atrributes() 更方便添加自定义属性
3.文本内容
a(href="google.com",title ="google") Hello World
多行文本:
p.
xxxxxxx
xxxxxx
xxx
或者
p
|xxxx <strong>hey</strong>
|xxxx
|xx
4.变量
-var htmlData ='<strong>srf</strong>
p#{htmlData} 或者 p=htmlData
p!=htmlData 或者 p!{htmlData}
5.注释
Jade支持两种注释:单行注释和多行注释。没中注释支持两种模式:输出源文件和不输出源文件
//单行