mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(search): fix default config
This commit is contained in:
parent
515331763d
commit
2efd859f71
@ -91,6 +91,7 @@ function bindEvents () {
|
||||
if (!value) {
|
||||
$panel.classList.remove('show')
|
||||
$panel.innerHTML = ''
|
||||
return
|
||||
}
|
||||
const matchs = search(value)
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ const CONFIG = {
|
||||
|
||||
const install = function (hook, vm) {
|
||||
const util = Docsify.util
|
||||
const opts = vm.config.search
|
||||
const opts = vm.config.search || CONFIG
|
||||
|
||||
if (Array.isArray(opts)) {
|
||||
CONFIG.paths = opts
|
||||
@ -23,11 +23,11 @@ const install = function (hook, vm) {
|
||||
|
||||
hook.mounted(_ => {
|
||||
initComponet(CONFIG)
|
||||
isAuto && initSearch(CONFIG, vm)
|
||||
!isAuto && initSearch(CONFIG, vm)
|
||||
})
|
||||
hook.doneEach(_ => {
|
||||
updateComponent(CONFIG, vm)
|
||||
!isAuto && initSearch(CONFIG, vm)
|
||||
isAuto && initSearch(CONFIG, vm)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ export function genIndex (path, content = '') {
|
||||
INDEXS[slug] = { slug, title: '', body: '' }
|
||||
} else {
|
||||
if (INDEXS[slug].body) {
|
||||
INDEXS[slug].body += ('\n' + token.text)
|
||||
INDEXS[slug].body += '\n' + (token.text || '')
|
||||
} else {
|
||||
INDEXS[slug].body = token.text
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user