我正在关注来自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
没有成功。