如何从 Castra 后端将数组传递给 Hoplon
How to pass an array into Hoplon from a Castra backend
如果我尝试将一个数组放入 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”放在最后一个例子中,它就可以工作。
干杯
如果我尝试将一个数组放入 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”放在最后一个例子中,它就可以工作。
干杯