vuepress-theme-reco/mixins/posts.js
reco_luan 720c6dbe35 refactor: get post data
use mixin(post)
2019-12-04 13:59:02 +08:00

21 lines
409 B
JavaScript

import { filterPostData, sortPostData } from '../helpers/postData'
export default {
computed: {
$recoPosts () {
const {
$categories: { list: articles }
} = this
let posts = articles.reduce((allData, currnetData) => {
return [...allData, ...currnetData.pages]
}, [])
posts = filterPostData(posts)
sortPostData(posts)
return posts
}
}
}