0

我需要根据某些条件替换元素的内容。如果不满足条件,则元素应保持不变。

(enlive/deftemplate template (io/resource "templ.html")
  []
  [:#el_id] (if (condition)
              (enlive/content ...)
              ;; otherwise identity transformation here
              ))

我试图nil用作身份转换,但它只是删除了元素。

4

1 回答 1

1

identity功能完成这项工作。很抱歉给你添乱了。

于 2016-03-15T08:54:56.013 回答