Browse Source

fix(ux): compatiable herf for the classical ui button component

charlie 1 năm trước cách đây
mục cha
commit
f5bf5a4bfb
1 tập tin đã thay đổi với 5 bổ sung0 xóa
  1. 5 0
      src/main/frontend/ui.cljs

+ 5 - 0
src/main/frontend/ui.cljs

@@ -1046,6 +1046,11 @@
                 button-props)
 
         icon (when icon (shui-ui/tabler-icon icon icon-props))
+        href? (not (string/blank? href))
+        text (cond
+               href? [:a {:href href :target "_blank"
+                          :style {:color "inherit"}} text]
+               :else text)
         children [icon text]]
 
     (shui-ui/button props children)))