We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91a5bd4 commit d658169Copy full SHA for d658169
packages/@vuepress/plugin-active-header-links/mixin.js
@@ -68,8 +68,12 @@ export default {
68
69
methods: {
70
onScroll: throttle(function () {
71
+ const anchors = getAnchors()
72
+ if (anchors.length === 0) {
73
+ return
74
+ }
75
this.$lastAnchor = this.$currentAnchor
- this.$currentAnchor = calculateCurrentAnchor(getAnchors())
76
+ this.$currentAnchor = calculateCurrentAnchor(anchors)
77
if (!this.$lastAnchor || this.$lastAnchor.hash !== this.$currentAnchor.hash) {
78
this.$vuepress.$emit('AnchorHashChange', this.$currentAnchor)
79
}
0 commit comments