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
abca36bd
Commit
abca36bd
authored
Aug 30, 2017
by
nikogu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed list loading
parent
bbb56769
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
48 deletions
+44
-48
src/routes/List/CardList.js
src/routes/List/CardList.js
+30
-32
src/routes/List/CoverCardList.js
src/routes/List/CoverCardList.js
+11
-16
src/routes/List/CoverCardList.less
src/routes/List/CoverCardList.less
+3
-0
No files found.
src/routes/List/CardList.js
View file @
abca36bd
import
React
,
{
PureComponent
}
from
'
react
'
;
import
React
,
{
PureComponent
}
from
'
react
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
Row
,
Col
,
Card
,
Avatar
,
Spin
,
Button
,
Icon
}
from
'
antd
'
;
import
{
Card
,
Avatar
,
Button
,
Icon
,
List
}
from
'
antd
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
...
@@ -53,37 +53,35 @@ export default class CardList extends PureComponent {
...
@@ -53,37 +53,35 @@ export default class CardList extends PureComponent {
extraContent
=
{
extraContent
}
extraContent
=
{
extraContent
}
>
>
<
div
className
=
{
styles
.
cardList
}
>
<
div
className
=
{
styles
.
cardList
}
>
{
<
List
loading
?
loading
=
{
loading
}
<
Spin
/>
grid
=
{{
gutter
:
16
,
lg
:
3
,
md
:
2
,
sm
:
1
,
xs
:
1
}}
:
>
<
Row
gutter
=
{
16
}
>
<
List
.
Item
>
<
Col
lg
=
{
8
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
24
}
style
=
{{
marginBottom
:
16
}}
>
<
Button
type
=
"
dashed
"
className
=
{
styles
.
newButton
}
>
<
Button
type
=
"
dashed
"
className
=
{
styles
.
newButton
}
>
<
Icon
type
=
"
plus
"
/>
ζ°ε’δΊ§ε
<
Icon
type
=
"
plus
"
/>
ζ°ε’δΊ§ε
<
/Button
>
<
/Button
>
<
/List.Item
>
<
/Col
>
{
{
list
&&
list
.
map
(
item
=>
(
list
&&
list
.
map
(
item
=>
(
<
List
.
Item
key
=
{
item
.
id
}
>
<
Col
lg
=
{
8
}
md
=
{
12
}
sm
=
{
12
}
xs
=
{
24
}
key
=
{
item
.
id
}
style
=
{{
marginBottom
:
16
}}
>
<
Card
<
Card
actions
=
{[
<
a
>
ζδ½δΈ
<
/a>, <a>ζδ½δΊ</
a
>
]}
actions
=
{[
<
a
>
ζδ½δΈ
<
/a>, <a>ζδ½δΊ</
a
>
]}
>
>
<
Card
.
Meta
<
Card
.
Meta
avatar
=
{
<
Avatar
size
=
"
large
"
src
=
{
item
.
avatar
}
/>
}
avatar
=
{
<
Avatar
size
=
"
large
"
src
=
{
item
.
avatar
}
/>
}
title
=
{
item
.
title
}
title
=
{
item
.
title
}
description
=
{(
description
=
{(
<
p
className
=
{
styles
.
cardDescription
}
>
<
p
className
=
{
styles
.
cardDescription
}
>
<
span
>
{
item
.
description
}
<
/span
>
<
span
>
{
item
.
description
}
<
/span
>
<
/p
>
<
/p
>
)}
)}
/
>
/
>
<
/Card
>
<
/Card
>
<
/List.Item
>
<
/Col
>
))
))
}
}
<
/List
>
<
/Row
>
}
<
/div
>
<
/div
>
<
/PageHeaderLayout
>
<
/PageHeaderLayout
>
);
);
...
...
src/routes/List/CoverCardList.js
View file @
abca36bd
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
...
@@ -2,7 +2,7 @@ import React, { PureComponent } from 'react';
import
moment
from
'
moment
'
;
import
moment
from
'
moment
'
;
import
{
connect
}
from
'
dva
'
;
import
{
connect
}
from
'
dva
'
;
import
{
routerRedux
}
from
'
dva/router
'
;
import
{
routerRedux
}
from
'
dva/router
'
;
import
{
Row
,
Col
,
Form
,
Card
,
Select
,
Spin
}
from
'
antd
'
;
import
{
Row
,
Col
,
Form
,
Card
,
Select
,
List
}
from
'
antd
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
PageHeaderLayout
from
'
../../layouts/PageHeaderLayout
'
;
import
StandardFormRow
from
'
../../components/StandardFormRow
'
;
import
StandardFormRow
from
'
../../components/StandardFormRow
'
;
...
@@ -72,10 +72,13 @@ export default class CoverCardList extends PureComponent {
...
@@ -72,10 +72,13 @@ export default class CoverCardList extends PureComponent {
const
{
getFieldDecorator
}
=
form
;
const
{
getFieldDecorator
}
=
form
;
const
cardList
=
list
?
(
const
cardList
=
list
?
(
<
Row
gutter
=
{
16
}
style
=
{{
marginTop
:
16
}}
>
<
List
loading
=
{
loading
}
grid
=
{{
gutter
:
16
,
lg
:
4
,
md
:
3
,
sm
:
2
,
xs
:
1
}}
>
{
{
list
.
map
(
item
=>
(
list
.
map
(
item
=>
(
<
Col
lg
=
{
6
}
md
=
{
8
}
sm
=
{
12
}
xs
=
{
24
}
style
=
{{
marginBottom
:
16
}}
key
=
{
item
.
id
}
>
<
List
.
Item
key
=
{
item
.
id
}
>
<
Card
<
Card
cover
=
{
<
img
alt
=
{
item
.
title
}
src
=
{
item
.
cover
}
/>
}
cover
=
{
<
img
alt
=
{
item
.
title
}
src
=
{
item
.
cover
}
/>
}
>
>
...
@@ -100,10 +103,10 @@ export default class CoverCardList extends PureComponent {
...
@@ -100,10 +103,10 @@ export default class CoverCardList extends PureComponent {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/Card
>
<
/Card
>
<
/
Col
>
<
/
List.Item
>
))
))
}
}
<
/
Row
>
<
/
List
>
)
:
null
;
)
:
null
;
const
tabList
=
[
const
tabList
=
[
...
@@ -209,17 +212,9 @@ export default class CoverCardList extends PureComponent {
...
@@ -209,17 +212,9 @@ export default class CoverCardList extends PureComponent {
<
/StandardFormRow
>
<
/StandardFormRow
>
<
/Form
>
<
/Form
>
<
/Card
>
<
/Card
>
{
<
div
className
=
{
styles
.
cardList
}
>
loading
&&
(
list
.
length
>
0
)
&&
<
Spin
>
{
cardList
}
{
cardList
}
<
/div
>
<
/Spin
>
}
{
loading
&&
(
list
.
length
<
1
)
&&
<
div
style
=
{{
marginTop
:
16
}}
><
Spin
/><
/div
>
}
{
!
loading
&&
cardList
}
<
/div
>
<
/div
>
<
/PageHeaderLayout
>
<
/PageHeaderLayout
>
);
);
...
...
src/routes/List/CoverCardList.less
View file @
abca36bd
...
@@ -21,4 +21,7 @@
...
@@ -21,4 +21,7 @@
flex: 0 1 auto;
flex: 0 1 auto;
}
}
}
}
.cardList {
margin-top: 24px;
}
}
}
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