Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/443.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 材质界面:如何在react admin中替换背景图像css<;登录/>;?_Javascript_Css_Reactjs_Material Ui_React Admin - Fatal编程技术网

Javascript 材质界面:如何在react admin中替换背景图像css<;登录/>;?

Javascript 材质界面:如何在react admin中替换背景图像css<;登录/>;?,javascript,css,reactjs,material-ui,react-admin,Javascript,Css,Reactjs,Material Ui,React Admin,我正在阅读以下文档: React Admin自定义登录背景: 材质UI自定义主题: 我不想使用背景,我想编辑css styles属性,其中使用: const useStyles = makeStyles( (theme: Theme) => ({ main: { backgroundImage: 'radial-gradient(circle at 50% 14em, #313264 0%, #00023b 60%, #00023b 10

我正在阅读以下文档:

  • React Admin自定义登录背景:
  • 材质UI自定义主题:
我不想使用背景,我想编辑css styles属性,其中使用:

const useStyles = makeStyles(
    (theme: Theme) => ({
        main: {
            backgroundImage: 'radial-gradient(circle at 50% 14em, #313264 0%, #00023b 60%, #00023b 100%)',
        },
    }),
    { name: 'RaLogin' }
);
根据mui文档(),它应该是可重写的,如下所示:

import { createMuiTheme } from '@material-ui/core/styles';
import pink from '@material-ui/core/colors/pink';

/**
 * @public
 * @name theme
 * @description
 * Application material ui main theme, read more at https://material-ui.com
 * It is used to configure the spacings, colors, fonts and components of the application
 * @type {object}
 */
const theme = createMuiTheme({
  overrides: {
    RaLogin: {
      main: {
            backgroundImage: 'radial-gradient(circle at 50% 14em, #ff0000 0%, #ff0000 60%, #ff0000 100%)',
      },
    }
  },
});
React管理文档通过将道具
backgroundImage
传递给
,展示了如何使用图像,但这不是我需要的


如何在Material UI/React Admin中编辑日志背景?

此选项适用于我:

const useStyles = makeStyles(theme => ({
  main: {
    background: 'radial-gradient(circle at 50% 14em, #313264 0%, #00023b 60%, #00023b 100%)', 
  },
}))

const LoginPage = props => {
  const classes = useStyles()
  return <Login classes={classes} backgroundImage="" {...props} />
}

const App = () => (
  <Admin
    loginPage={LoginPage}
    ...

  </Admin>
)    
const useStyles=makeStyles(主题=>({
主要内容:{
背景:“径向梯度(50%14em处的圆圈,#313264 0%,#00023b 60%,#00023b 100%),
},
}))
const LoginPage=props=>{
常量类=useStyles()
返回
}
常量应用=()=>(