mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-04 09:04:02 +00:00
fix Cannot read property 'addEventListener' of null #946
This commit is contained in:
@@ -59,19 +59,18 @@ class PrimaryLayout extends PureComponent {
|
||||
|
||||
// Localized route name.
|
||||
|
||||
const lang = langFromPath(location.pathname);
|
||||
const lang = langFromPath(location.pathname)
|
||||
const newRouteList =
|
||||
lang !== 'en'
|
||||
lang !== 'en'
|
||||
? routeList.map(item => {
|
||||
const { name , ...other } = item
|
||||
const { name, ...other } = item
|
||||
return {
|
||||
...other,
|
||||
name: ((item[lang] || {}).name || name),
|
||||
name: (item[lang] || {}).name || name,
|
||||
}
|
||||
})
|
||||
: routeList
|
||||
|
||||
|
||||
// Find a route that matches the pathname.
|
||||
const currentRoute = newRouteList.find(
|
||||
_ => _.route && pathMatchRegexp(_.route, location.pathname)
|
||||
@@ -148,7 +147,7 @@ class PrimaryLayout extends PureComponent {
|
||||
</Content>
|
||||
<BackTop
|
||||
className={styles.backTop}
|
||||
target={() => document.querySelector('#primaryLayout>div')}
|
||||
target={() => document.querySelector('#primaryLayout')}
|
||||
/>
|
||||
<GlobalFooter
|
||||
className={styles.footer}
|
||||
|
||||
Reference in New Issue
Block a user