Commit d2bb7729 authored by Evan You's avatar Evan You

tweak name

parent 5a123910
...@@ -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 fetchInitialData = 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: fetchInitialData,
components: { components: {
Spinner, Spinner,
NewsItem NewsItem
...@@ -60,7 +60,7 @@ export default { ...@@ -60,7 +60,7 @@ export default {
} }
}, },
mounted () { mounted () {
fetchData(this.$store) fetchInitialData(this.$store)
if (this.page > this.maxPage) { if (this.page > this.maxPage) {
this.$router.push('/') this.$router.push('/')
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment