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 に答える