| 315 | }; |
| 316 | |
| 317 | var install = function (hook, vm) { |
| 318 | var util = Docsify.util; |
| 319 | var opts = vm.config.search || CONFIG; |
| 320 | |
| 321 | if (Array.isArray(opts)) { |
| 322 | CONFIG.paths = opts; |
| 323 | } else if (typeof opts === 'object') { |
| 324 | CONFIG.paths = Array.isArray(opts.paths) ? opts.paths : 'auto'; |
| 325 | CONFIG.maxAge = util.isPrimitive(opts.maxAge) ? opts.maxAge : CONFIG.maxAge; |
| 326 | CONFIG.placeholder = opts.placeholder || CONFIG.placeholder; |
| 327 | CONFIG.noData = opts.noData || CONFIG.noData; |
| 328 | CONFIG.depth = opts.depth || CONFIG.depth; |
| 329 | CONFIG.hideOtherSidebarContent = opts.hideOtherSidebarContent || CONFIG.hideOtherSidebarContent; |
| 330 | } |
| 331 | |
| 332 | var isAuto = CONFIG.paths === 'auto'; |
| 333 | |
| 334 | hook.mounted(function (_) { |
| 335 | init(CONFIG, vm); |
| 336 | !isAuto && init$1(CONFIG, vm); |
| 337 | }); |
| 338 | hook.doneEach(function (_) { |
| 339 | update(CONFIG, vm); |
| 340 | isAuto && init$1(CONFIG, vm); |
| 341 | }); |
| 342 | }; |
| 343 | |
| 344 | $docsify.plugins = [].concat(install, $docsify.plugins); |
| 345 | |