vuepress-theme-reco/mixins/posts.js

21 lines
409 B
JavaScript
Raw Normal View History

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
}
}
}