From cc469d8785d645c2490e36561f31f7091321a660 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 31 Aug 2019 21:59:14 -0400 Subject: [PATCH] fix: handle anchor links within the page contents (#1006) --- client/themes/default/components/page.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/themes/default/components/page.vue b/client/themes/default/components/page.vue index 97fcfb3c..7927e9a9 100644 --- a/client/themes/default/components/page.vue +++ b/client/themes/default/components/page.vue @@ -314,6 +314,14 @@ export default { if (window.location.hash && window.location.hash.length > 1) { this.$vuetify.goTo(window.location.hash, this.scrollOpts) } + + this.$refs.container.querySelectorAll(`a[href^="#"], a[href^="${window.location.href.replace(window.location.hash, '')}#"]`).forEach(el => { + el.onclick = ev => { + ev.preventDefault() + ev.stopPropagation() + this.$vuetify.goTo(ev.target.hash, this.scrollOpts) + } + }) }) }, methods: {