我正在使用包含clojurescript(reagent-material-ui)的材料-ui框架和一个小型桌面应用程序的试剂。我想知道,当我使用reagent/as-element
函数构造一个React元素时,我可以通过道具和风格,如果是这样,怎么样?
答案 0 :(得分:0)
看起来ragent-material-ui
正在使用cljsjs/material-ui "0.19.0-0"
。适用的材料-ui样式文档为here。
我会根据文档给出类似这样的镜头。
;; Using inline styles
(ns my.project
(:require [reagent-material-ui.core :as ui]
[reagent.core :as reagent]))
(reagent/as-element [ui/IconMenu
{:iconButtonElement
(el [ui/IconButton {:touch true} [icon "more_vert"]])
:style {}} ;; Your inline styles here
[ui/MenuItem "Delete"]])
;; Using component specific overrides
;; (depending on the type of element you are styling this will differ)
(reagent/as-element [ui/IconMenu
{:iconButtonElement
(el [ui/IconButton {:touch true} [icon "more_vert"]])
:listStyle {}} ;; Your root element overrides here
[ui/MenuItem "Delete"]])