diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index b408a5dc..295aa766 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,9 +1,14 @@ // https://vitepress.dev/guide/custom-theme import PtjsTheme from '@project-trans/vitepress-theme-project-trans/theme' - +import { App } from 'vue'; +import SearchWithAria from '../../../packages/vitepress-theme-project-trans/src/components/SearchWithAria.vue'; // 引入组件 import 'uno.css' import './style.css' export default { extends: PtjsTheme, + enhanceApp({ app }: { app: App }) { + // 全局注册组件 + app.component('SearchWithAria', SearchWithAria); + } } diff --git a/packages/vitepress-theme-project-trans/src/components/SearchWithAria.vue b/packages/vitepress-theme-project-trans/src/components/SearchWithAria.vue index 7afdc906..f64a8798 100644 --- a/packages/vitepress-theme-project-trans/src/components/SearchWithAria.vue +++ b/packages/vitepress-theme-project-trans/src/components/SearchWithAria.vue @@ -1,7 +1,6 @@