Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
189c5882
Commit
189c5882
authored
Jan 25, 2019
by
陈帅
Committed by
陈小聪
Jan 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove PureComponent (#3470)
* remove PureComponent * fix typo
parent
b095b0bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
41 deletions
+25
-41
src/components/SiderMenu/SiderMenu.js
src/components/SiderMenu/SiderMenu.js
+1
-1
src/components/SiderMenu/index.less
src/components/SiderMenu/index.less
+2
-2
src/layouts/BasicLayout.js
src/layouts/BasicLayout.js
+1
-1
src/layouts/Header.js
src/layouts/Header.js
+2
-2
src/layouts/UserLayout.js
src/layouts/UserLayout.js
+19
-35
No files found.
src/components/SiderMenu/SiderMenu.js
View file @
189c5882
...
@@ -51,7 +51,7 @@ export default class SiderMenu extends PureComponent {
...
@@ -51,7 +51,7 @@ export default class SiderMenu extends PureComponent {
const
defaultProps
=
collapsed
?
{}
:
{
openKeys
};
const
defaultProps
=
collapsed
?
{}
:
{
openKeys
};
const
siderClassName
=
classNames
(
styles
.
sider
,
{
const
siderClassName
=
classNames
(
styles
.
sider
,
{
[
styles
.
fixSider
b
ar
]:
fixSiderbar
,
[
styles
.
fixSider
B
ar
]:
fixSiderbar
,
[
styles
.
light
]:
theme
===
'
light
'
,
[
styles
.
light
]:
theme
===
'
light
'
,
});
});
return
(
return
(
...
...
src/components/SiderMenu/index.less
View file @
189c5882
...
@@ -25,13 +25,13 @@
...
@@ -25,13 +25,13 @@
font-weight: 600;
font-weight: 600;
}
}
}
}
.sider {
.sider {
min-height: 100vh;
min-height: 100vh;
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35);
position: relative;
position: relative;
z-index: 10;
z-index: 10;
&.fixSiderbar {
&.fixSiderBar {
box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
position: fixed;
position: fixed;
top: 0;
top: 0;
left: 0;
left: 0;
...
...
src/layouts/BasicLayout.js
View file @
189c5882
...
@@ -51,7 +51,7 @@ const query = {
...
@@ -51,7 +51,7 @@ const query = {
},
},
};
};
class
BasicLayout
extends
React
.
Pure
Component
{
class
BasicLayout
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
getPageTitle
=
memoizeOne
(
this
.
getPageTitle
);
this
.
getPageTitle
=
memoizeOne
(
this
.
getPageTitle
);
...
...
src/layouts/Header.js
View file @
189c5882
import
React
,
{
Pure
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
{
formatMessage
}
from
'
umi/locale
'
;
import
{
Layout
,
message
}
from
'
antd
'
;
import
{
Layout
,
message
}
from
'
antd
'
;
import
Animate
from
'
rc-animate
'
;
import
Animate
from
'
rc-animate
'
;
...
@@ -10,7 +10,7 @@ import styles from './Header.less';
...
@@ -10,7 +10,7 @@ import styles from './Header.less';
const
{
Header
}
=
Layout
;
const
{
Header
}
=
Layout
;
class
HeaderView
extends
Pure
Component
{
class
HeaderView
extends
Component
{
state
=
{
state
=
{
visible
:
true
,
visible
:
true
,
};
};
...
...
src/layouts/UserLayout.js
View file @
189c5882
...
@@ -31,42 +31,26 @@ const copyright = (
...
@@ -31,42 +31,26 @@ const copyright = (
<
/Fragment
>
<
/Fragment
>
);
);
class
UserLayout
extends
React
.
PureComponent
{
const
UserLayout
=
({
children
})
=>
(
// @TODO title
// @TODO <DocumentTitle title={this.getPageTitle()}>
// getPageTitle() {
<
div
className
=
{
styles
.
container
}
>
// const { routerData, location } = this.props;
<
div
className
=
{
styles
.
lang
}
>
// const { pathname } = location;
<
SelectLang
/>
// let title = 'Ant Design Pro';
<
/div
>
// if (routerData[pathname] && routerData[pathname].name) {
<
div
className
=
{
styles
.
content
}
>
// title = `${routerData[pathname].name} - Ant Design Pro`;
<
div
className
=
{
styles
.
top
}
>
// }
<
div
className
=
{
styles
.
header
}
>
// return title;
<
Link
to
=
"
/
"
>
// }
<
img
alt
=
"
logo
"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
render
()
{
<
/Link
>
const
{
children
}
=
this
.
props
;
return
(
// @TODO <DocumentTitle title={this.getPageTitle()}>
<
div
className
=
{
styles
.
container
}
>
<
div
className
=
{
styles
.
lang
}
>
<
SelectLang
/>
<
/div
>
<
div
className
=
{
styles
.
content
}
>
<
div
className
=
{
styles
.
top
}
>
<
div
className
=
{
styles
.
header
}
>
<
Link
to
=
"
/
"
>
<
img
alt
=
"
logo
"
className
=
{
styles
.
logo
}
src
=
{
logo
}
/
>
<
span
className
=
{
styles
.
title
}
>
Ant
Design
<
/span
>
<
/Link
>
<
/div
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
{
children
}
<
/div
>
<
/div
>
<
GlobalFooter
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
div
className
=
{
styles
.
desc
}
>
Ant
Design
是西湖区最具影响力的
Web
设计规范
<
/div
>
<
/div
>
<
/div
>
);
{
children
}
}
<
/div
>
}
<
GlobalFooter
links
=
{
links
}
copyright
=
{
copyright
}
/
>
<
/div
>
);
export
default
UserLayout
;
export
default
UserLayout
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment