- for (var i=0;i<3;i++) li scnu-learn //這裏的=,默認會轉義內容 p= "Welcome scnu <strong>good</strong> school" //若是不想被轉義,在=前加! p!= "Welcome scnu <strong>good</strong> school" //使用變量 - var name="jade" p my name is #{name} //若是要輸出#{},須要使用\來轉義 p my name is \#{name} //變量中的特殊字符會被轉義,若是想獲得不轉義的,使用!代替# - var chV="<script></script>" p #{chV} p !{chV} //循環 //數組實例 - var jobs=["teacher","student","worker"] each val in jobs li= val //對象實例 - var student={xuehao:201230,name:'wangjie'} each val,key in student li #{key} : #{val} //case - var apples = 10 case apples when 0 p you have no apples when 1 p you have an apples default p you have #{apples} apples
註釋使用數組
h3 單行註釋 //h1.title#title index test h3 非緩衝註釋 //-div(id='div01',class='div') h3 塊註釋 //-p a(href='http://www.baidu.com',title='name') link input(type='text',value='jie') input(type='checkbox',checked)