Reactjs 在材质中显示下划线-UI InputBase组件

Reactjs 在材质中显示下划线-UI InputBase组件,reactjs,material-ui,Reactjs,Material Ui,我有一个由InputBase组件组成的搜索栏。 为什么有下划线?InputBase应该是普通的(没有装饰) 这是指向该项目的github链接。 . 搜索栏位于src/components下,请使用disableUnderline属性 <InputBase className={classes.input} placeholder='Search' InputProps={{'aria-label': 'search', disableUnderline : true }

我有一个由InputBase组件组成的搜索栏。 为什么有下划线?InputBase应该是普通的(没有装饰) 这是指向该项目的github链接。 .
搜索栏位于src/components下,请使用
disableUnderline
属性

<InputBase 
   className={classes.input}
   placeholder='Search'
   InputProps={{'aria-label': 'search', disableUnderline : true }}
/>

或者使用makeStyles

import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles({
  underline: {
    "&&&:before": {
      borderBottom: "none"
    },
    "&&:after": {
      borderBottom: "none"
    }
  }
});


<InputBase 
   className={classes.input}
   placeholder='Search'
   InputProps={{'aria-label': 'search',classes }}
/>
从“@material ui/core/styles”导入{makeStyles}”;
const useStyles=makeStyles({
下划线:{
“&&&:之前”:{
borderBottom:“无”
},
“&&:after”:{
borderBottom:“无”
}
}
});

使用
禁用下划线
属性

<InputBase 
   className={classes.input}
   placeholder='Search'
   InputProps={{'aria-label': 'search', disableUnderline : true }}
/>

或者使用makeStyles

import { makeStyles } from "@material-ui/core/styles";
const useStyles = makeStyles({
  underline: {
    "&&&:before": {
      borderBottom: "none"
    },
    "&&:after": {
      borderBottom: "none"
    }
  }
});


<InputBase 
   className={classes.input}
   placeholder='Search'
   InputProps={{'aria-label': 'search',classes }}
/>
从“@material ui/core/styles”导入{makeStyles}”;
const useStyles=makeStyles({
下划线:{
“&&&:之前”:{
borderBottom:“无”
},
“&&:after”:{
borderBottom:“无”
}
}
});