charlie 1 год назад
Родитель
Сommit
94ed777d41
1 измененных файлов с 8 добавлено и 3 удалено
  1. 8 3
      deps/shui/src/logseq/shui/demo2.cljs

+ 8 - 3
deps/shui/src/logseq/shui/demo2.cljs

@@ -19,7 +19,7 @@
                             :X-RapidAPI-Host "movies-api14.p.rapidapi.com"}})
      (p/then #(.json %)))))
 
-(rum/defc page
+(rum/defc multi-select-demo
   []
 
   [:div.sm:p-10
@@ -80,7 +80,7 @@
                                           (-> (do-fetch! :search (str "query=" v))
                                             (p/then #(when-let [ret (bean/->clj %)]
                                                        (when-let [items (:contents ret)]
-                                                         (set-items! (map (fn [item] (assoc item :id (:_id item))) (take 8 items))))))
+                                                         (set-items! (map (fn [item] (assoc item :id (:_id item))) (take 12 items))))))
                                             (p/finally #(set-fetching? false))))))
 
               :item-render (fn [item {:keys [selected?]}]
@@ -320,6 +320,7 @@
                             (ui/popup-show! (.-target e)
                               (gen-content q)
                               {:id id
+                               :align "start"
                                :content-props
                                {:class "x-input-popup-content"
                                 :onPointerDownOutside
@@ -357,4 +358,8 @@
                      {:as-menu? true
                       :content-props {:class "w-48"}})
         :on-context-menu #(ui/popup-show! %
-                            [:h1.text-3xl.font-bold "hi x popup for custom context menu!"])}]])])
+                            [:h1.text-3xl.font-bold "hi x popup for custom context menu!"])}]])])
+
+(rum/defc page
+  []
+  (multi-select-demo))