fix: sidebar highlight
This commit is contained in:
parent
7a4d9bc5cd
commit
f82f41900e
2 changed files with 2646 additions and 406 deletions
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…
Add table
Add a link
Reference in a new issue