Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sample
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周韬
node-sample
Commits
b9bfdd85
Commit
b9bfdd85
authored
Jun 01, 2017
by
Eliurkis Diaz
Committed by
Evan You
Jun 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor code (#195)
parent
253a3aad
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
getters.js
src/store/getters.js
+6
-4
No files found.
src/store/getters.js
View file @
b9bfdd85
...
@@ -3,14 +3,16 @@ export default {
...
@@ -3,14 +3,16 @@ export default {
// current list type and current pagination
// current list type and current pagination
activeIds
(
state
)
{
activeIds
(
state
)
{
const
{
activeType
,
itemsPerPage
,
lists
}
=
state
const
{
activeType
,
itemsPerPage
,
lists
}
=
state
if
(
!
activeType
)
{
return
[]
}
const
page
=
Number
(
state
.
route
.
params
.
page
)
||
1
const
page
=
Number
(
state
.
route
.
params
.
page
)
||
1
if
(
activeType
)
{
const
start
=
(
page
-
1
)
*
itemsPerPage
const
start
=
(
page
-
1
)
*
itemsPerPage
const
end
=
page
*
itemsPerPage
const
end
=
page
*
itemsPerPage
return
lists
[
activeType
].
slice
(
start
,
end
)
return
lists
[
activeType
].
slice
(
start
,
end
)
}
else
{
return
[]
}
},
},
// items that should be currently displayed.
// items that should be currently displayed.
...
...
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