init config by window.
This commit is contained in:
parent
7be6baae7a
commit
897283418a
3 changed files with 53 additions and 39 deletions
|
|
@ -1,8 +1,8 @@
|
|||
import { load, camel2kebab, isNil, getRoute } from './util'
|
||||
import { load, camel2kebab, isNil, getRoute, merge } from './util'
|
||||
import { scrollIntoView, activeLink } from './event'
|
||||
import * as render from './render'
|
||||
|
||||
const OPTIONS = {
|
||||
const OPTIONS = merge({
|
||||
el: '#app',
|
||||
repo: '',
|
||||
maxLevel: 6,
|
||||
|
|
@ -16,7 +16,7 @@ const OPTIONS = {
|
|||
coverpage: '',
|
||||
basePath: '',
|
||||
auto2top: false
|
||||
}
|
||||
}, window.$docsify)
|
||||
const script = document.currentScript || [].slice.call(document.getElementsByTagName('script')).pop()
|
||||
|
||||
// load configuration for script attribute
|
||||
|
|
@ -32,7 +32,7 @@ if (script) {
|
|||
}
|
||||
|
||||
// load options
|
||||
render.config(OPTIONS)
|
||||
render.init(OPTIONS)
|
||||
|
||||
let cacheRoute = null
|
||||
let cacheXhr = null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue