Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jade multiline Object / Array

Tags:

html

pug

I need to know how to split into lines objects / arrays in jade.

This works fine:

object = [{foo: bar, bar:foo},{foo: bar, bar:foo},{foo: bar, bar:foo}]

This doesn't:

object = [
   {foo: bar, bar:foo},
   {foo: bar, bar:foo},
   {foo: bar, bar:foo}
]

This doesn't either:

- object = [
-       {foo: bar, bar:foo},
-       {foo: bar, bar:foo},
-       {foo: bar, bar:foo}
- ]
like image 430
Fede Avatar asked Nov 03 '22 23:11

Fede


1 Answers

Documentation on pug site says that this should work (keep track of the white spaces) :

-
  var object = [
    {foo: bar, bar:foo},
    {foo: bar, bar:foo},
    {foo: bar, bar:foo}
  ]
like image 121
Avraham Avatar answered Nov 08 '22 08:11

Avraham