Jade: declare a variable over multiple lines

我只是一个虾纸丫 提交于 2019-12-05 00:16:50

Jade now supports multineline variables, as described in the docs:

-
  list = ["Uno", "Dos", "Tres",
          "Cuatro", "Cinco", "Seis"]
each item in list
  li= item
damphat

Your question surprised me. I have made some tests in Jade:

This worked (as you said):

person = {name: 'Bill', age: 50}

This worked too:

- person = {name: 'Bill', age: 50}

This did not (Jade could not compile it:

- person = {
-   name: 'Bill',
-   age: 50
- }

This is a good workaround:

- person = {}
- person.name = 'Bill'
- person.age = 50
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!