好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

Jade模板引擎(一)之Attributes_html/css_WEB-ITnose

目录:

Attributes Boolean Attributes Style Attributes Class Attributes &Attributes

Attributes

jade中的属性和html中的属性并没有什么太大区别, 值也和js的规则没有什么两样。

1. js表达式

jade:

- var authenticated = truea(class=authenticated ? 'authed' : 'anon') 

html:

 

2. 多属性换行

jade:

input(  type='checkbox'  name='agreement'  checked) 

html:

  

3. 非转义属性( Unescaped Attributes )

默认情况下, 所有属性都是转义过的。这样做是为了安全起见,防止XSS攻击。如果需要使用特殊字符,可以使用"!="替代"="。

jade:

div(escaped=" ")div(unescaped=" ") 

html:

查看更多关于Jade模板引擎(一)之Attributes_html/css_WEB-ITnose的详细内容...

  阅读:29次