Fix hash link in docs module (#7768)

This commit is contained in:
Rijk van Zanten
2021-09-01 19:35:03 -04:00
committed by GitHub
parent e50b75a4b7
commit 7b32f0c5a0

View File

@@ -131,11 +131,14 @@ export default defineComponent({
if (link.startsWith('http') || link.startsWith('#')) return;
event.preventDefault();
const parts = link.split('#');
parts[0] = parts[0].endsWith('/') ? parts[0].slice(0, -1) : parts[0];
router.push({
path: `/docs${parts[0]}`,
hash: parts[1],
hash: `#${parts[1]}`,
});
}
}