refactor(core): add scroll event
This commit is contained in:
parent
27e7e749af
commit
8cae16539d
5 changed files with 86 additions and 170 deletions
|
|
@ -2,6 +2,8 @@ import { get } from './ajax'
|
|||
import { callHook } from '../init/lifecycle'
|
||||
import { getRoot } from '../route/util'
|
||||
import { noop } from '../util/core'
|
||||
import { scrollIntoView } from '../event/scroll'
|
||||
import { getAndActive } from '../event/sidebar'
|
||||
|
||||
export function fetchMixin (Docsify) {
|
||||
let last
|
||||
|
|
@ -57,7 +59,8 @@ export function fetchMixin (Docsify) {
|
|||
export function initFetch (vm) {
|
||||
vm._fetchCover(vm)
|
||||
vm._fetch(result => {
|
||||
vm.$resetEvents()
|
||||
scrollIntoView(vm.route.query.id)
|
||||
getAndActive('nav')
|
||||
callHook(vm, 'doneEach')
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue