mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-12-02 12:10:04 +08:00
allow the user's $docsify config to be a function that receives as input the Docsify instance
This commit is contained in:
parent
b2e6123980
commit
f72bf4cc9a
@ -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 =
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user