diff --git a/src/core/config.js b/src/core/config.js index c351790..981f4d0 100644 --- a/src/core/config.js +++ b/src/core/config.js @@ -2,7 +2,7 @@ import { merge, hyphenate, isPrimitive, hasOwn } from './util/core'; const currentScript = document.currentScript; -export default function() { +export default function(vm) { const config = merge( { el: '#app', @@ -35,7 +35,9 @@ export default function() { relativePath: false, topMargin: 0, }, - window.$docsify + typeof window.$docsify === 'function' + ? window.$docsify(vm) + : window.$docsify ); const script = diff --git a/src/core/init/index.js b/src/core/init/index.js index 9231acc..255aad0 100644 --- a/src/core/init/index.js +++ b/src/core/init/index.js @@ -9,7 +9,7 @@ import { initLifecycle, callHook } from './lifecycle'; export function initMixin(proto) { proto._init = function() { const vm = this; - vm.config = config(); + vm.config = config(vm); initLifecycle(vm); // Init hooks initPlugin(vm); // Install plugins