nebula/pages/index.vue

34 lines
647 B
Vue
Raw Normal View History

2020-06-19 17:10:44 +08:00
<template>
<div>
2020-06-22 17:13:42 +08:00
<article-list :articles="articles" @currentChange="currentChangeArticle"></article-list>
2020-06-19 17:10:44 +08:00
</div>
</template>
2020-06-22 17:13:42 +08:00
<script>
import ArticleList from '~/components/archive/list'
export default {
name: 'Index',
fetch({store}) {
return Promise.all([
store.dispatch('article/fetchList')
])
},
components: {
ArticleList
},
computed: {
articles() {
return this.$store.state.article.list.data
}
},
methods: {
currentChangeArticle(page) {
this.$store.dispatch('article/fetchList', {page: page})
}
}
}
</script>
2020-06-19 17:10:44 +08:00
<style>
</style>