我可以设置凸起按钮的边框半径吗?

kur*_*n26 7 reactjs material-ui

我尝试像这样设置边框半径:

const styles = {
   btn:{
         height: 30,
         fontSize: 11,
         borderRadius: 50
   }
}
Run Code Online (Sandbox Code Playgroud)

它不起作用。我已阅读文档但找不到答案。

Moh*_*tha 11

更新(2020 年 6 月)

在新版本的 Material-ui 中,不再需要两个 props stylebuttonStyle需要style就足够了,从 0.x 到 1.x 的迁移现在已被. 这是原始答案中代码的现代版本RaisedButton variant="contained"

<Button variant="contained" color="secondary" style={{ borderRadius: 50 }}/>
Run Code Online (Sandbox Code Playgroud)

https://codesandbox.io/s/rounded-raised-button-w86o8?file=/index.js:0-361

原始答案(2018 年 4 月)

这对我有用

 <RaisedButton secondary buttonStyle={{ borderRadius: 50 }} style={{borderRadius:50}}>FF</RaisedButton>
Run Code Online (Sandbox Code Playgroud)

同时给出stylebuttonStyle。style 覆盖父级div内联样式

https://codesandbox.io/s/7o39499v9x