简体   繁体   English

多行写入pug数组

[英]Write pug array in multiple lines

I want to write my pug array in multiple lines like this: 我想在多行中编写我的pug数组,如下所示:

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

but pug doesnt allow it. 但哈巴狗不允许。 I have to write it inline like this atm: 我必须像这样的atm内联编写它:

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

Any idea? 任何想法? Thanks for help. 感谢帮助。

As suggested in https://github.com/pugjs/pug/issues/502#issuecomment-137893041 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. 请注意, -在单独的行上。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM