Sorting related articles by date is done client-side using a computed property:
// _slug.vue
computed: {
sortedSimilar() {
return this.similarArticles.sort((first, second) => {
return new Date(first.created) < new Date(second.created)
})
}
},
However, this only works when the the page is accessed directly. If the page is navigated to, this does not seem to work
Sorting related articles by date is done client-side using a computed property:
However, this only works when the the page is accessed directly. If the page is navigated to, this does not seem to work