mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix: sidebar highlight
This commit is contained in:
parent
7a4d9bc5cd
commit
f82f41900e
3048
package-lock.json
generated
3048
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -86,7 +86,7 @@ export function scrollActiveSidebar (router) {
|
||||
href = router.parse(href).query.id
|
||||
}
|
||||
|
||||
nav[decodeURIComponent(href)] = li
|
||||
if (href) nav[decodeURIComponent(href)] = li
|
||||
}
|
||||
|
||||
dom.off('scroll', highlight)
|
||||
@ -96,6 +96,8 @@ export function scrollActiveSidebar (router) {
|
||||
}
|
||||
|
||||
export function scrollIntoView (id) {
|
||||
if (!id) return
|
||||
|
||||
const section = dom.find('#' + id)
|
||||
section && scrollTo(section)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user