如何在Material-UI中删除扩展面板的边框? [英] How can I remove the border of expansion panel in Material-UI?

查看:58
本文介绍了如何在Material-UI中删除扩展面板的边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Material-UI中删除扩展面板区域的边框?

How can I remove the border of expansion panel area in Material-UI?

推荐答案

此版本适用于版本" @ material-ui/core":"4.9.9 "

This works for version "@material-ui/core": "4.9.9"

您可以将以下内容应用于整个主题:

You can use the following to be applied for the entire theme:

const theme = createMuiTheme({
  overrides: {
    MuiExpansionPanel: {
      root: {
        '&:before': {
          display: 'none'
        },
      },
    },
  }
}

或者,如果您只需要一个组件,则可以通过类样式将其隐藏:

Or if you need it only for one component then can be hidden through a class style:

import { makeStyles } from '@material-ui/core/styles'

....
const useStyles = makeStyles({
  hideBorder: {
    '&.MuiExpansionPanel-root:before': {
      display: 'none',
    },
  },
})

....
const classes = useStyles()

.....
<ExpansionPanel className={classes.hideBorder}>

这篇关于如何在Material-UI中删除扩展面板的边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆