我试图为html表定义一个enlive模板,该模板显示来自地图的数据。本例中的template-div是正确的这里。模板中单元格的虚拟内容是这里。
单元格值的defsnippet和deftemplate定义为:
(require '[net.cgrand.enlive-html :as html])
(html/defsnippet value-cell (template-div) [:div.Row :div.Cell] [value]
(html/content value))但是,当我尝试这个片段时
(value-cell (mapv vals (:event-data dummy-content)))所有的值都在一个标签中,如下所示
({:tag :div, :attrs {:class "Cell"},
:content ("end time 1" "date 1" "event name 1" "start time 1" "performer 1" "end time 2" "date 2" "event name 2" "start time 2" "performer 2")})我需要列表中的每一项都是标签中的值。
发布于 2014-10-07 20:50:00
您要将值列表传递给值单元格,因此值单元格应该如下所示:
(html/defsnippet value-cell (template-div)
[:div.Row :div.Cell]
[values]
(html/clone-for [value values]
(html/content value)))https://stackoverflow.com/questions/26239972
复制相似问题