Ant-design-pro: 🧐[问题]怎么修改ant-layout-header高度?默认值48px,尝试了多重方法未果

Created on 11 Sep 2020  ·  2Comments  ·  Source: ant-design/ant-design-pro

🧐 问题描述

修改了 config/defaultSettings.ts 中的配置,如下:

export default {
  navTheme: 'light',
  primaryColor: '#1890ff',
  layout: 'top',
  contentWidth: 'Fluid',
  fixedHeader: true,
  headerHeight: 88, // 修改了这里
  fixSiderbar: false,
  colorWeak: false,
  menu: {
    locale: true,
  },
  contentStyle: {
    margin: '0px'
  },
  pwa: false,
  iconfontUrl: '',
} as LayoutSettings & {
  pwa: boolean
}

也尝试过修改 config/config.ts 中的配置,如下:

export default defineConfig({
  hash: true,
  antd: { dark: false },
  dva: {
    hmr: true,
  },
  exportStatic: {
    htmlSuffix: false, // ture=users.html   false=users/index.html
  },
  layout: {
    locale: true,
    siderWidth: 208,
    headerHeight: 88, // 修改了这里
  },
  locale: {
    default: 'zh-CN',
    antd: true,
    baseNavigator: true,
  },
  dynamicImport: {
    loading: '@/components/PageLoading/index',
  },
  targets: {
    ie: 11,
  },
  routes: Routes,
  theme: {
    'primary-color': defaultSettings.primaryColor,
  },
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || 'dev'],
  manifest: {
    basePath: '/',
  },
});

但最终头部导航条高度仍然是48px,求教如何修改header高度

💻 示例代码

🚑 其他信息

image

🕵🏻‍♀️ question

Most helpful comment

defaultSettings.js 里新增 headerHeight: 64 实测管用

All 2 comments

defaultSettings.js 里新增 headerHeight: 64 实测管用

pro-layout 从6.0.0-3升级到6.4.16后问题解决

Was this page helpful?
0 / 5 - 0 ratings