From 6894024ad43931cad49efbdf006b7c66d585e32c Mon Sep 17 00:00:00 2001 From: Dominik Pschenitschni Date: Sun, 30 Jan 2022 16:48:02 +0100 Subject: [PATCH] fix: use to.hash for returned element --- src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index abeed38b3..fee8fdfa0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -81,7 +81,7 @@ const router = createRouter({ // Scroll to anchor should still work if (to.hash) { - return {el: document.getElementById(to.hash.slice(1))} + return {el: to.hash} } // Otherwise just scroll to the top