最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Write pug array in multiple lines - Stack Overflow

programmeradmin0浏览0评论

I want to write my pug array in multiple lines like this:

- var data = [
  ["1", "1.1"], 
  "2"
]

but pug doesnt allow it. I have to write it inline like this atm:

- var data = [["1", "1.1"], "2"]

Any idea? Thanks for help.

I want to write my pug array in multiple lines like this:

- var data = [
  ["1", "1.1"], 
  "2"
]

but pug doesnt allow it. I have to write it inline like this atm:

- var data = [["1", "1.1"], "2"]

Any idea? Thanks for help.

Share Improve this question asked Jan 17, 2017 at 0:08 phngphng 3523 silver badges13 bronze badges 1
  • Or how can I realise this? To work with an json object would be much more comfortable? naltatis.github.io/jade-syntax-docs/#variables – phng Commented Jan 17, 2017 at 0:11
Add a comment  | 

1 Answer 1

Reset to default 22

As suggested in https://github.com/pugjs/pug/issues/502#issuecomment-137893041

try this:

- 
  var data = [
    ["1", "1.1"], 
    "2"
  ]

Note that the - is on a separate line.

发布评论

评论列表(0)

  1. 暂无评论