diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index 0f7349b3..32b68f96 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -161,6 +161,18 @@ debouncedWatch( // Silence warnings about missing components app.config.warnHandler = () => {} app.provide(dataSymbol, vitePressData) + Object.defineProperties(app.config.globalProperties, { + $frontmatter: { + get() { + return vitePressData.frontmatter.value + } + }, + $params: { + get() { + return vitePressData.page.value.params + } + } + }) const div = document.createElement('div') app.mount(div) const sections = div.innerHTML.split(headingRegex)