fix: async install config, fixed #425

This commit is contained in:
qingwei.li 2018-03-19 09:56:29 +08:00
commit e4e011c81f
2 changed files with 61 additions and 59 deletions

View file

@ -1,5 +1,6 @@
import {merge, hyphenate, isPrimitive, hasOwn} from './util/core' import {merge, hyphenate, isPrimitive, hasOwn} from './util/core'
export default function () {
const config = merge( const config = merge(
{ {
el: '#app', el: '#app',
@ -65,4 +66,5 @@ if (script) {
window.$docsify = config window.$docsify = config
export default config return config
}

View file

@ -9,7 +9,7 @@ import {isFn} from '../util/core'
export function initMixin(proto) { export function initMixin(proto) {
proto._init = function () { proto._init = function () {
const vm = this const vm = this
vm.config = config || {} vm.config = config()
initLifecycle(vm) // Init hooks initLifecycle(vm) // Init hooks
initPlugin(vm) // Install plugins initPlugin(vm) // Install plugins