nebula/pages/drafts.vue

43 lines
865 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",
2022-10-27 23:22:46 +08:00
middleware: 'auth',
2020-08-02 19:22:39 +08:00
components: {
DraftList
},
2022-10-09 09:42:21 +08:00
fetch() {
let {store, error} = this.$nuxt.context
2020-08-02 19:22:39 +08:00
return Promise.all([
store
.dispatch('draft/fetchList')
.catch(err => error({statusCode: 404}))
])
},
computed: {
...mapState({
articles: state => state.draft.list.data,
2022-10-27 23:22:46 +08:00
user: state => state.auth.user
2020-08-02 19:22:39 +08:00
})
},
mounted() {
this.$store.commit('setActiveMenu', 'drafts');
2020-08-02 19:22:39 +08:00
}
}
</script>
<style scoped>
</style>