2024-09-11 00:03:13 +08:00

22 lines
628 B
TypeScript

import { h } from 'vue'
import { defineClientConfig } from 'vuepress/client'
import type { ClientConfig } from 'vuepress/client'
import Search from './components/Search.vue'
import type { SearchBoxLocales, SearchOptions } from '../shared/index.js'
declare const __SEARCH_LOCALES__: SearchBoxLocales
declare const __SEARCH_OPTIONS__: SearchOptions
const locales = __SEARCH_LOCALES__
const searchOptions = __SEARCH_OPTIONS__
export default defineClientConfig({
enhance({ app }) {
app.component('SearchBox', props => h(Search, {
locales,
options: searchOptions,
...props,
}))
},
}) as ClientConfig