Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧐[问题 | question]umi/max 在app.tsx设置菜单侧边背景色colorMenuBackground未生效 #11210

Open
Alextale777 opened this issue Apr 12, 2024 · 1 comment

Comments

@Alextale777
Copy link

🧐 问题描述 | Problem description

我在app.tsx中设置token,想通过colorMenuBackground token来改变侧边栏的背景色, 但并未生效,仍旧是默认的transparent背景色

💻 示例代码 | Sample code

export const layout: RunTimeLayoutConfig = (initialState) => { return { logo: logo, title: 'test', menu: { locale: false, }, token: { colorMenuBackground: '#fff' }, layout: 'mix', avatarProps: { size: 'small', title: '七妮妮', render: (props, dom) => { return ( <Dropdown menu={{ items: [ { key: 'logout', label: ( <Button type={'text'} onClick={signOut}> 登出 </Button> ), }, ], }} > {dom} </Dropdown> ); }, }, }; };

🚑 其他信息 | Other information

版本信息:
umi/max 4.0.89
antd 5.4.0
@ant-design/pro-components 2.4.4

OS: win11

Node:18.17.0

浏览器 | browser:

@cyc2016
Copy link

cyc2016 commented May 16, 2024

如果在app.tsx文件中设置token,需要放在...initialState?.settings的后面,否则会被/config/defaultSettings.ts中设置的token属性覆盖,要么就在/config/defaultSettings.ts文件中设置

而且菜单侧边背景色设置完整是:

token: {
    sider: {
        colorMenuBackground: '#fff'
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants