Replies: 1 comment 1 reply
-
Figured it out I extended the default theme and added this i my custom layout's mounted hook
Is there a better way to get the next and previous page's paths then reading it from the button? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was able to add prev / next keyboard navigation using vanilla js and I'll show below how I did that. But page changes as a result are a bit slow compared to using the internal router. I understand that the router is easily exposed using
const router = useRouter();
but I'm confused about where I have to place the logic so that it will be on every page and how to access the current page's prev/next page info so that I can pass it torouter.go()
Can someone lend a hand?
This is how I have it working at the moment, I just added this in config.mjs
Beta Was this translation helpful? Give feedback.
All reactions