File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 5454* ** Type:** `` Boolean ``
5555* ** Description:** Display chapter name.
5656
57- ### pagination.routerMode
57+ ### ~~ pagination.routerMode~~
58+ * ** Deprecated**
5859* ** Default:** [ ` window.$docsify.routerMode ` ] ( https://docsify.js.org/#/configuration?id=routermode )
5960* ** Type:** `` String ``
6061* ** Description:** Router mode. In most cases, you don't need to modify it. Docsify-Pagination will take care of it for you.
Original file line number Diff line number Diff line change @@ -6,16 +6,11 @@ import './stylesheet.css'
66/**
77 * constants
88 */
9- const ROUTER_MODE = {
10- HASH : 'hash' ,
11- HISTORY : 'history' ,
12- }
139const DEFAULT_OPTIONS = ( config ) => ( {
1410 previousText : 'PREVIOUS' ,
1511 nextText : 'NEXT' ,
1612 crossChapter : false ,
1713 crossChapterText : false ,
18- routerMode : config . routerMode || ROUTER_MODE . HASH ,
1914} )
2015const CONTAINER_CLASSNAME = 'docsify-pagination-container'
2116
@@ -69,11 +64,9 @@ class Link {
6964 }
7065}
7166
72- function pagination ( vm , { crossChapter, routerMode } ) {
67+ function pagination ( vm , { crossChapter } ) {
7368 try {
74- const path = routerMode === ROUTER_MODE . HISTORY ?
75- vm . route . path :
76- `#${ vm . route . path } `
69+ const path = vm . router . toURL ( vm . route . path )
7770 const all = toArray ( query . all ( '.sidebar-nav li a' ) ) . filter ( ( element ) => ! matches ( element , '.section-link' ) )
7871 const active = all . find ( isALinkTo ( path ) )
7972 const group = toArray ( ( closest ( active , 'ul' ) || { } ) . children )
You can’t perform that action at this time.
0 commit comments