用于调整react-admin应用的侧边栏的简单解决方案

问题描述 投票:0回答:1

我只是想根据此处的“ Sidebar Customization”文档定义边栏的宽度:https://marmelab.com/react-admin/Theming.html

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

const theme = createMuiTheme({
    sidebar: { // <- Error 'sidebar' does not exist in type 'ThemeOptions'
        width: 300, // The default value is 240
        closedWidth: 70, // The default value is 55
    },
});
const App = () => (
    <Admin theme={theme} dataProvider={simpleRestProvider('http://path.to.my.api')}>
        // ...
    </Admin>
);

我得到一个:

 'sidebar' does not exist in type 'ThemeOptions'

查看material-ui.core.styles.ThemeOptions时是正确的,>

简单地调整边栏大小的最简单方法是什么?我喜欢这样做,因为我的MenuItemLink文本与边栏的大小重叠。

我只是想根据此处的“侧栏自定义”文档定义侧边栏的宽度:https://marmelab.com/react-admin/Theming.html import {createMuiTheme} from'@material -...] >

react-admin
1个回答
0
投票

不需要createMuiTheme()调用:

const darkTheme = {
  sidebar: {
    width: 220, 
    closedWidth: 55, 
  },
}  
© www.soinside.com 2019 - 2024. All rights reserved.