如果我试图在index.cljs.hl页面中使用数组,我该如何使用Clojurescript中的数组呢?我发现我可以使用:
(loop-tpl :bindings [single-data rpc/test-vector]
(h2 single-data))在hLisp部分,但是如果我想使用上面的数组,我似乎遇到了问题。rpc.cljs页面中的数组如下所示
(defc= test-vector ["Good" "Man" "Shoe"])我试着使用不带数据的map,只用一个数组,它是有效的:
(defn build-list
[]
(map #(h2 %) ["one" "two" "three"]))但是如果我尝试使用数组,它就不再起作用了,而且我也不知道为什么。
(defn build-list
[]
(map #(h2 %) rpc/test-vector))干杯
发布于 2017-12-20 12:09:49
如果你把'@rpc/test-vector‘和上一个例子放在一起,它就行了。
干杯
https://stackoverflow.com/questions/47884386
复制相似问题