nebula/pages/drafts.vue

41 lines
805 B
Vue
Raw Normal View History

2020-08-02 19:22:39 +08:00
<template>
<el-row class="wrapper">
<el-col style="margin-bottom: 1rem;">
<h1>我的草稿</h1>
</el-col>
<draft-list :articles="articles"></draft-list>
</el-row>
</template>
<script>
import DraftList from '~/components/common/draft/list';
import {mapState} from 'vuex';
export default {
name: "Drafts",
components: {
DraftList
},
fetch({store, error}) {
return Promise.all([
store
.dispatch('draft/fetchList')
.catch(err => error({statusCode: 404}))
])
},
computed: {
...mapState({
articles: state => state.draft.list.data,
user: state => state.oauth
})
},
mounted() {
this.$store.commit('setActiveMenu', 'drafts');
2020-08-02 19:22:39 +08:00
}
}
</script>
<style scoped>
</style>