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
d2bb7729
Commit
d2bb7729
authored
Aug 05, 2016
by
Evan You
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak name
parent
5a123910
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
News.vue
src/views/News.vue
+3
-3
No files found.
src/views/News.vue
View file @
d2bb7729
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
import
Spinner
from
'../components/Spinner.vue'
import
Spinner
from
'../components/Spinner.vue'
import
NewsItem
from
'../components/NewsItem.vue'
import
NewsItem
from
'../components/NewsItem.vue'
const
fetchData
=
store
=>
{
const
fetch
Initial
Data
=
store
=>
{
return
store
return
store
.
dispatch
(
`FETCH_TOP_IDS`
)
.
dispatch
(
`FETCH_TOP_IDS`
)
.
then
(()
=>
store
.
dispatch
(
`FETCH_NEWS`
))
.
then
(()
=>
store
.
dispatch
(
`FETCH_NEWS`
))
...
@@ -34,7 +34,7 @@ const fetchData = store => {
...
@@ -34,7 +34,7 @@ const fetchData = store => {
export
default
{
export
default
{
name
:
'news'
,
name
:
'news'
,
prefetch
:
fetchData
,
prefetch
:
fetch
Initial
Data
,
components
:
{
components
:
{
Spinner
,
Spinner
,
NewsItem
NewsItem
...
@@ -60,7 +60,7 @@ export default {
...
@@ -60,7 +60,7 @@ export default {
}
}
},
},
mounted
()
{
mounted
()
{
fetchData
(
this
.
$store
)
fetch
Initial
Data
(
this
.
$store
)
if
(
this
.
page
>
this
.
maxPage
)
{
if
(
this
.
page
>
this
.
maxPage
)
{
this
.
$router
.
push
(
'/'
)
this
.
$router
.
push
(
'/'
)
}
}
...
...
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