1
我正在創建一個文檔,這將幫助我減少創建模板時的時間。我想要在一個單獨的文件中使用我在主文件的頭文件中指定的數組來循環代碼塊,但似乎無法使其工作帕格2 - 在循環中推送數組
./src/pug /layout.pug
- const flyouts = []
- flyouts.push({variationid: "123", plugin: "none", zone: "ZoneHere", variation: "LargeImage", link: "www.bbc.co.uk", imgloc: "blah.jpg"});
- flyouts.push({variationid: "456", plugin: "none", zone: "ZoneHere", variation: "LargeImage", link: "www.bbc.co.uk", imgloc: "blah.jpg"});
這裏調用循環,在同一個文件
html
head
title Hello asd
body
section
// Flyouts
each myFlyout in flyouts
include components/flyouts
其中在./src/pug/components/flyouts.pug
012調用的代碼塊.section(variationid=variationid plugin=plugin zone=zone variation=variation)
a(href='asd')
img(src='http' alt="Event" width="206" height="148" border="0")
任何人都可以照亮這一個?
這工程。非常感謝你!! – JimKT