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
|
|
|
|
},
|
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,
|
|
|
|
user: state => state.oauth
|
|
|
|
})
|
2020-11-30 20:42:24 +08:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.$store.commit('setActiveMenu', 'drafts');
|
2020-08-02 19:22:39 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
|
|
</style>
|