feat(theme): add global component NavbarSearch
This commit is contained in:
parent
82051c2398
commit
20340f735f
@ -1,4 +1,5 @@
|
||||
import { defineClientConfig } from '@vuepress/client'
|
||||
import { h } from 'vue'
|
||||
import { setupDarkMode } from './composables/index.js'
|
||||
import Layout from './layouts/Layout.vue'
|
||||
import NotFound from './layouts/NotFound.vue'
|
||||
@ -6,6 +7,17 @@ import NotFound from './layouts/NotFound.vue'
|
||||
import './styles/index.scss'
|
||||
|
||||
export default defineClientConfig({
|
||||
enhance({ app }) {
|
||||
// eslint-disable-next-line vue/match-component-file-name
|
||||
app.component('NavbarSearch', () => {
|
||||
const SearchComponent =
|
||||
app.component('Docsearch') || app.component('SearchBox')
|
||||
if (SearchComponent) {
|
||||
return h(SearchComponent)
|
||||
}
|
||||
return null
|
||||
})
|
||||
},
|
||||
setup() {
|
||||
setupDarkMode()
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user