如果我正在尝试将数组放入index.cljs.hl页面,我该如何在Clojurescript中使用该数组。我发现我可以使用:
(loop-tpl :bindings [single-data rpc/test-vector]
(h2 single-data))
在hLisp部分,但如果我想使用html标签上面的数组,我似乎遇到了问题。 rpc.cljs页面中的数组如下所示
(defc= test-vector ["Good" "Man" "Shoe"])
我尝试使用没有数据的地图,只是一个数组,它的工作原理:
(defn build-list
[]
(map #(h2 %) ["one" "two" "three"]))
但是,如果我尝试使用数组它不再有效,我不知道为什么。
(defn build-list
[]
(map #(h2 %) rpc/test-vector))
干杯
如果你把'@ rpc / test-vector'和最后一个例子放在一起就行了。
干杯