使用Jade向元素添加多个属性

Ran*_*lue 16 pug

在Jade中,input(type='text' placeholder='Type in text')产生语法错误.什么是正确的语法?

Jus*_*ith 27

你需要一个逗号:

input(type='text', placeholder='Type in text')
Run Code Online (Sandbox Code Playgroud)

https://github.com/visionmedia/jade/blob/master/examples/attributes.jade

快乐的编码!


小智 6

您可以使用逗号.

input(type='text', placeholder='Type in text')
Run Code Online (Sandbox Code Playgroud)

或新线.

input(type='text'
      placeholder='Type in text')
Run Code Online (Sandbox Code Playgroud)

请参阅文档.https://github.com/visionmedia/jade#attributes