试剂形式多选不适合列表

时间:2016-05-03 20:31:33

标签: clojure clojurescript reagent reagent-forms

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

0 个答案:

没有答案