fix: sidebar highlight

This commit is contained in:
qingwei.li 2017-09-01 15:50:53 +08:00
parent 7a4d9bc5cd
commit f82f41900e
2 changed files with 2646 additions and 406 deletions

3048
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -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)