如何在所有Material UI对话框上通用设置类?

时间:2019-08-18 07:24:17

标签: reactjs material-ui material-ui-dialog

我有很多Material UI dialog我想在所有这些人上设置library(adapr) library(htmlTable) library(stringr) data = data.frame("word"=c('python py', 'java'), "description"=c('Java is a statically typed and Python py is a dynamically typed', 'java is a programming language'), stringsAsFactors = FALSE) ll <- as.list(data$word) data$new <- data$description for(i in seq_len(nrow(data))) for(j in seq_along(ll)) { url <- paste0("http://www.google.com/",ll[[j]]) url1 <- makeHyperlink(url,ll[[j]]) url2 <- str_replace(url1,"file:///","") data$new[i] <- sub(ll[[j]], url2, data$new[i], ignore.case = TRUE) } data1<-htmlTable(data) 类。我该怎么办?

rg-dialog

1 个答案:

答案 0 :(得分:2)

如果要全局设置材料组件的样式,请尝试overriding the default material theme。我可能看起来像:

const themeOptions = {
  overrides: {
    MuiDialog: {
      // your override styles here. for example, the following overrides dialog's "root" class
      root: {
        padding: 5
      }
    }
  }
};

const theme = createMuiTheme(themeOptions);

然后在ThemeProvider

中使用修改后的主题
<ThemeProvider theme={theme}>

如果您是Material-UI中的新手,请check out the docs