Commit cc469d87 authored by Nick's avatar Nick

fix: handle anchor links within the page contents (#1006)

parent eac12121
...@@ -314,6 +314,14 @@ export default { ...@@ -314,6 +314,14 @@ export default {
if (window.location.hash && window.location.hash.length > 1) { if (window.location.hash && window.location.hash.length > 1) {
this.$vuetify.goTo(window.location.hash, this.scrollOpts) 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: { methods: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment