diff --git a/src/components/anchor/anchor.vue b/src/components/anchor/anchor.vue index 0e273d20..c86a8aff 100644 --- a/src/components/anchor/anchor.vue +++ b/src/components/anchor/anchor.vue @@ -93,6 +93,7 @@ export default { handleHashChange () { const url = window.location.href; const sharpLinkMatch = sharpMatcherRegx.exec(url); + if (!sharpLinkMatch) return; this.currentLink = sharpLinkMatch[0]; this.currentId = sharpLinkMatch[1]; },