我正在关注http://yogthos.github.io/reagent-forms-example.html中的示例代码,并尝试使用多选项作为列表。
(defn select-item [item]
(go
(reset! current-selection item)
(let [response (<! (check-for-response))]
(reset! current-response response)
(reset! past-response response))))
;;batch
(defn item-list []
[:div#items-list
[items-list-header]
[:ul.list-group.items {:field :multi-select :id :pick-a-few}
(if (pos? (count @items))
(doall (for [item @items]
^{:key (item "upc")}
[:li.list-group-item [:a {:class (set-item-class item) :on-click #(select-item item) :href "#"}
(item "description")]]))
[:li [:a "No Items For This Department"]])]])
(defn product-component []
[:div
[item-list]
[product-response]
;[bind-fields item-list items]
;[bind-fields item-list product-response]
])
有谁知道为什么我无法进行多选? select-item
中的逻辑会改变,但我似乎无法在UI中看到多选
我在bind-fields
中一直在弄product component
但没有成功。