diff --git a/docs/en/guide/custom-theme.md b/docs/en/guide/custom-theme.md index 8de4c7ab..5811ad14 100644 --- a/docs/en/guide/custom-theme.md +++ b/docs/en/guide/custom-theme.md @@ -62,11 +62,14 @@ import Layout from './Layout.vue' export default { Layout, enhanceApp({ app, router, siteData }) { - // ... + // app.component(...) + // app.use(...) } } ``` +The `enhanceApp` hook allows you to access the [Vue app instance](https://vuejs.org/api/application.html) and other runtime data, which can be used to [register global components](./extending-default-theme.md#registering-global-components), integrate with Vue libraries, etc. + The `router` value is the same VitePress router instance returned by [`useRouter()`](../reference/runtime-api#userouter). To listen for route changes, assign handlers on the router: ```ts [.vitepress/theme/index.ts]