refactor(core): add router
This commit is contained in:
parent
8bee8f0213
commit
30da0d5d46
17 changed files with 316 additions and 88 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { isMobile } from '../util/env'
|
||||
import { dom, on } from '../util/dom'
|
||||
import { body, on } from '../util/dom'
|
||||
import * as sidebar from './sidebar'
|
||||
|
||||
export function eventMixin (Docsify) {
|
||||
|
|
@ -14,6 +14,6 @@ export function initEvent (vm) {
|
|||
if (vm.config.coverpage) {
|
||||
!isMobile && on('scroll', sidebar.sticky)
|
||||
} else {
|
||||
dom.body.classList.add('sticky')
|
||||
body.classList.add('sticky')
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { isMobile } from '../util/env'
|
||||
import { getNode, on, dom } from '../util/dom'
|
||||
import { getNode, on, body } from '../util/dom'
|
||||
/**
|
||||
* Toggle button
|
||||
*/
|
||||
export function btn (el) {
|
||||
const toggle = () => dom.body.classList.toggle('close')
|
||||
const toggle = () => body.classList.toggle('close')
|
||||
|
||||
el = getNode(el)
|
||||
on(el, 'click', toggle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue