refactor(core): adjust directory structure:
This commit is contained in:
parent
e07d36f44e
commit
aad62b65f5
20 changed files with 381 additions and 93 deletions
17
src/core/route/index.js
Normal file
17
src/core/route/index.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { ensureSlash } from './hash'
|
||||
|
||||
export function routeMixin (Docsify) {
|
||||
Docsify.prototype.$route = {
|
||||
query: location.query || {},
|
||||
path: location.path || '/',
|
||||
base: ''
|
||||
}
|
||||
}
|
||||
|
||||
export function initRoute (vm) {
|
||||
ensureSlash()
|
||||
window.addEventListener('hashchange', () => {
|
||||
ensureSlash()
|
||||
vm.$fetch()
|
||||
})
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue