Genie view 中循环如何写?

根据Genie官网的例子:

    <% for_each(books) do book %>
  • $(book.title) by $(book.author)
  • <% end %>
运行时报错:UndefVarError: for_each not defined 请问循环不用for_each 应该用什么语法?

using Genie.Renderer.Html

function billgatesbooks()
[
Html.h1() do
“Bill Gates’ list of recommended books”
end
Html.ul() do
for_each(BillGatesBooks) do book
Html.li() do
book.title * " by " * book.author
end
end
end
]
end
这是完整代码,for_each是一个宏,但不知道要引用哪个包?请指教

using Genie.Renderer.Html

另外,代码快请用反引号包裹,例如


```julia 
using Genie.Renderer.Html
```

@AquaIndigo 谢谢

备案号:京ICP备17009874号-2