Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 652x 42x 70x 70x 70x 42x 582x | const position = () => (window.history.state as { position?: number } | null)?.position;
export default defineNuxtPlugin(({ $router }) => {
let current: number | undefined;
$router.beforeEach(() => {
const next = position();
const back = next !== undefined && current !== undefined && next < current;
document.documentElement.dataset.nav = back ? "back" : "forward";
});
$router.afterEach(() => {
current = position();
});
});
|