refactor(router): clean global api
This commit is contained in:
parent
2c7041c8fb
commit
8741c746df
12 changed files with 46 additions and 126 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { isMobile } from '../util/env'
|
||||
import * as dom from '../util/dom'
|
||||
import { parse } from '../router/hash'
|
||||
|
||||
const nav = {}
|
||||
let hoverOver = false
|
||||
|
|
@ -53,7 +52,7 @@ function highlight () {
|
|||
}
|
||||
}
|
||||
|
||||
export function scrollActiveSidebar () {
|
||||
export function scrollActiveSidebar (router) {
|
||||
if (isMobile) return
|
||||
|
||||
const sidebar = dom.getNode('.sidebar')
|
||||
|
|
@ -66,7 +65,7 @@ export function scrollActiveSidebar () {
|
|||
let href = a.getAttribute('href')
|
||||
|
||||
if (href !== '/') {
|
||||
href = parse(href).query.id
|
||||
href = router.parse(href).query.id
|
||||
}
|
||||
|
||||
nav[decodeURIComponent(href)] = li
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue