mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-30 05:13:43 +00:00
1、本地化
2、解决侧边栏收起时菜单图标悬浮下无菜单文字显示的问题
This commit is contained in:
@@ -31,9 +31,9 @@ const Menus = ({ siderFold, darkTheme, navOpenKeys, changeOpenKeys, menu, locati
|
||||
}
|
||||
return (
|
||||
<Menu.Item key={item.id}>
|
||||
<Link to={item.route || '#'}>
|
||||
<Link to={item.route || '#'} style={siderFoldN ? {width: 10} : {}}>
|
||||
{item.icon && <Icon type={item.icon} />}
|
||||
{(!siderFoldN || !menuTree.includes(item)) && item.name}
|
||||
<span>{item.name}</span>
|
||||
</Link>
|
||||
</Menu.Item>
|
||||
)
|
||||
|
||||
@@ -3,6 +3,9 @@ import PropTypes from 'prop-types'
|
||||
import { Switch, Route, Redirect, routerRedux } from 'dva/router'
|
||||
import dynamic from 'dva/dynamic'
|
||||
import App from 'routes/app'
|
||||
import {LocaleProvider} from 'antd';
|
||||
import zh_CN from 'antd/lib/locale-provider/zh_CN';
|
||||
import 'moment/locale/zh-cn';
|
||||
|
||||
const { ConnectedRouter } = routerRedux
|
||||
|
||||
@@ -67,6 +70,7 @@ const Routers = function ({ history, app }) {
|
||||
|
||||
return (
|
||||
<ConnectedRouter history={history}>
|
||||
<LocaleProvider locale={zh_CN}>
|
||||
<App>
|
||||
<Switch>
|
||||
<Route exact path="/" render={() => (<Redirect to="/dashboard" />)} />
|
||||
@@ -85,6 +89,7 @@ const Routers = function ({ history, app }) {
|
||||
<Route component={error} />
|
||||
</Switch>
|
||||
</App>
|
||||
</LocaleProvider>
|
||||
</ConnectedRouter>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user