diff --git a/404.html b/404.html new file mode 100644 index 0000000000..df2c5b706e --- /dev/null +++ b/404.html @@ -0,0 +1,43 @@ + + +
+ + + + + +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.
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.
npm i -D @vuepress/plugin-active-header-links@next
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+ plugins: [
+ activeHeaderLinksPlugin({
+ // options
+ }),
+ ],
+}
Type: string
Default: 'a.vp-sidebar-item'
Details:
Selector of header link.
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.
Type: string
Default: '.header-anchor'
Details:
Selector of header anchor.
You don't need to specify this option unless you have changed the permalinkClass
option of markdown-it-anchor via markdown.anchor.
Also see:
Type: number
Default: 200
Details:
The delay of the debounced scroll event listener.
Type: number
Default: 5
Details:
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.
该插件会监听页面滚动事件。当页面滚动至某个 标题锚点 后,如果存在对应的 标题链接 ,那么该插件会将路由 Hash 更改为该 标题锚点 。
该插件主要用于开发主题,并且已经集成到默认主题中。大部分情况下你不需要直接使用它。
npm i -D @vuepress/plugin-active-header-links@next
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'
+
+export default {
+ plugins: [
+ activeHeaderLinksPlugin({
+ // 配置项
+ }),
+ ],
+}
类型: string
默认值: 'a.vp-sidebar-item'
详情:
标题链接 的选择器。
如果一个 标题锚点 没有对应的 标题链接 ,那么即使滚动到这个 标题锚点 ,该插件也不会更改路由 Hash 。
类型: string
默认值: '.header-anchor'
详情:
标题锚点 的选择器。
你通常不需要设置该选项,除非你通过 markdown.anchor 修改了 markdown-it-anchor 的 permalinkClass
选项。
参考:
类型: number
默认值: 200
详情:
滚动事件监听器的 Debounce 延迟。
类型: number
默认值: 5
详情:
即便直接点击 标题锚点 的链接, scrollTop
也可能不会完全等于 标题锚点 的 offsetTop
,所以我们添加一个 Offset 偏移量来避免这个误差。