diff --git a/src/components/PreviousNext.vue b/src/components/PreviousNext.vue index 98d00ab..a7db399 100644 --- a/src/components/PreviousNext.vue +++ b/src/components/PreviousNext.vue @@ -89,6 +89,7 @@ export default { }, methods: { getPreviousNext() { + this.PreviousNexts = [] const allBlogs = this.$static.allGhostPost.edges; for (let i = 0; i < allBlogs.length; i++) { if (allBlogs[i].node.id === this.currentPostId) { @@ -101,6 +102,13 @@ export default { } } } + }, + watch: { + id: function(val) { + console.log('Updating PreviousNext') + this.currentPostId = val + this.getPreviousNext() + } } };