You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin will listen to page scroll event. When the page scrolls to a certain _header anchor_, this plugin will change the route hash to that _header anchor_ if there is a corresponding _header link_.
6
+
7
+
This plugin is mainly used to develop themes, and has been integrated into the default theme. You won't need to use it directly in most cases.
8
+
9
+
## Options
10
+
11
+
### headerLinkSelector
12
+
13
+
- Type: `string`
14
+
15
+
- Default: `'.sidebar-link'`
16
+
17
+
- Details:
18
+
19
+
Selector of _header link_.
20
+
21
+
If a _header anchor_ does not have a corresponding _header link_, this plugin won't change the route hash to that anchor when scrolling to it.
22
+
23
+
### headerAnchorSelector
24
+
25
+
- Type: `string`
26
+
27
+
- Default: `'.header-anchor'`
28
+
29
+
- Details:
30
+
31
+
Selector of _header anchor_.
32
+
33
+
You don't need to specify this option unless you have changed the `permalinkClass` option of [markdown-it-anchor](https://github.com/valeriangalliat/markdown-it-anchor#readme) via [markdown.anchor](../config.md#markdown-anchor).
Even if you click the link of the _header anchor_ directly, the `scrollTop` might not be exactly equal to `offsetTop` of the _header anchor_, so we add an offset to avoid the error.
0 commit comments