K
K
Kuper1322017-10-02 20:46:44
css
Kuper132, 2017-10-02 20:46:44

how to use array in jade?

I want to make a menu. Everything looks like this

mixin menu-footer(...items)
  +b.menu-footer&attributes(attributes)
      +e('ul').menu
        each item in items
          +e('li')(class='item-' + item.itemclass)
            a.menu-item(href=item.refs)=item.name
+menu-footer({itemclass:'search',refs:'#', name:'Search'})

Interested in how you can do it with an array, so that you can add something like this
+menu-footer( [ {itemclass:'search', {refs:'#', name:'Search'}  ] )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PerfectPixel, 2017-12-06
@PerfectPixel

I'm not sure if I understood the question correctly, but look at this example https://codepen.io/perfectpixel/pen/EbmgEL it might help...
or here's How to add a class to jade (in a loop)?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question