Skip to content

use routeer for navigation and watch for changes

Ok - I took a look at this. I've focused my review on StoryPage.vue, since that is the component your current router setup references.

I think the setup was nearly there, but rather than updating the currentIndex ref manually in nextChapter() and prevChapter() I think the router-based approach would be to a) on initial page load, define the currentIndex based on the index router parameter, then b) use router.push() to navigate to the chapter page with the next or previous index, and then c) watch for changes to the router index parameter and update the currentIndex accordingly, which it turn will trigger the update to currentChapter.

I've got that setup working here, and I think it's working as you wanted, but you should confirm.

Merge request reports

Loading