|
|
@ -30,6 +30,7 @@ import { pathToFile } from '../../app/utils'
|
|
|
|
import { slash } from '../../shared'
|
|
|
|
import { slash } from '../../shared'
|
|
|
|
import { useData } from '../composables/data'
|
|
|
|
import { useData } from '../composables/data'
|
|
|
|
import { createTranslate } from '../support/translation'
|
|
|
|
import { createTranslate } from '../support/translation'
|
|
|
|
|
|
|
|
import { dataSymbol } from '../../app/data'
|
|
|
|
|
|
|
|
|
|
|
|
defineProps<{
|
|
|
|
defineProps<{
|
|
|
|
placeholder: string
|
|
|
|
placeholder: string
|
|
|
@ -62,8 +63,8 @@ interface Result {
|
|
|
|
text?: string
|
|
|
|
text?: string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const { localeIndex, theme } = useData()
|
|
|
|
const vitePressData = useData()
|
|
|
|
|
|
|
|
const { localeIndex, theme } = vitePressData
|
|
|
|
const searchIndex = computedAsync(async () =>
|
|
|
|
const searchIndex = computedAsync(async () =>
|
|
|
|
markRaw(
|
|
|
|
markRaw(
|
|
|
|
MiniSearch.loadJSON<Result>(
|
|
|
|
MiniSearch.loadJSON<Result>(
|
|
|
@ -153,6 +154,7 @@ debouncedWatch(
|
|
|
|
const app = createApp(comp)
|
|
|
|
const app = createApp(comp)
|
|
|
|
// Silence warnings about missing components
|
|
|
|
// Silence warnings about missing components
|
|
|
|
app.config.warnHandler = () => {}
|
|
|
|
app.config.warnHandler = () => {}
|
|
|
|
|
|
|
|
app.provide(dataSymbol, vitePressData)
|
|
|
|
const div = document.createElement('div')
|
|
|
|
const div = document.createElement('div')
|
|
|
|
app.mount(div)
|
|
|
|
app.mount(div)
|
|
|
|
const sections = div.innerHTML.split(headingRegex)
|
|
|
|
const sections = div.innerHTML.split(headingRegex)
|
|
|
|