mirror of
https://github.com/zhigang1992/docsify.git
synced 2026-04-23 21:00:06 +08:00
fix: sidebar highlight
This commit is contained in:
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user