Skip to content

Commit

Permalink
fix(theme): missing global properties in localSearch (#2396)
Browse files Browse the repository at this point in the history
  • Loading branch information
zonemeen committed May 21, 2023
1 parent 8153f23 commit 4896811
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client/theme-default/components/VPLocalSearchBox.vue
Expand Up @@ -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)
Expand Down

0 comments on commit 4896811

Please sign in to comment.