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
4c8ef953
Commit
4c8ef953
authored
Sep 06, 2018
by
JoeyKo
Committed by
εε³
Sep 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix fetchMore
parent
62ab8b47
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
src/models/list.js
src/models/list.js
+13
-0
src/pages/List/Articles.js
src/pages/List/Articles.js
+7
-1
No files found.
src/models/list.js
View file @
4c8ef953
...
...
@@ -15,6 +15,13 @@ export default {
payload
:
Array
.
isArray
(
response
)
?
response
:
[],
});
},
*
appendFetch
({
payload
},
{
call
,
put
})
{
const
response
=
yield
call
(
queryFakeList
,
payload
);
yield
put
({
type
:
'
appendList
'
,
payload
:
Array
.
isArray
(
response
)
?
response
:
[],
});
},
*
submit
({
payload
},
{
call
,
put
})
{
let
callback
;
if
(
payload
.
id
)
{
...
...
@@ -37,5 +44,11 @@ export default {
list
:
action
.
payload
,
};
},
appendList
(
state
,
action
)
{
return
{
...
state
,
list
:
state
.
list
.
concat
(
action
.
payload
),
};
},
},
};
src/pages/List/Articles.js
View file @
4c8ef953
...
...
@@ -19,7 +19,13 @@ const pageSize = 5;
}))
class
SearchList
extends
Component
{
componentDidMount
()
{
this
.
fetchMore
();
const
{
dispatch
}
=
this
.
props
;
dispatch
({
type
:
'
list/fetch
'
,
payload
:
{
count
:
5
,
},
});
}
setOwner
=
()
=>
{
...
...
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