From 8f66b42a0b0f9d3ccbae13525631cf10fef7ae4b Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Mon, 5 Sep 2022 20:51:39 +0530 Subject: [PATCH] docs: update extending the default theme (#1288) --- docs/guide/theme-introduction.md | 5 +++-- docs/guide/using-vue.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/guide/theme-introduction.md b/docs/guide/theme-introduction.md index 17d8a0b0ba37..19b062e816c1 100644 --- a/docs/guide/theme-introduction.md +++ b/docs/guide/theme-introduction.md @@ -109,9 +109,10 @@ import DefaultTheme from 'vitepress/theme' export default { ...DefaultTheme, - enhanceApp({ app }) { + enhanceApp(ctx) { + DefaultTheme.enhanceApp(ctx) // register global components - app.component('MyGlobalComponent', /* ... */) + ctx.app.component('MyGlobalComponent', /* ... */) } } ``` diff --git a/docs/guide/using-vue.md b/docs/guide/using-vue.md index 0ae948337559..16a4d237dd70 100644 --- a/docs/guide/using-vue.md +++ b/docs/guide/using-vue.md @@ -113,8 +113,9 @@ import DefaultTheme from 'vitepress/theme' export default { ...DefaultTheme, - enhanceApp({ app }) { - app.component('VueClickAwayExample', VueClickAwayExample) + enhanceApp(ctx) { + DefaultTheme.enhanceApp(ctx) + ctx.app.component('VueClickAwayExample', VueClickAwayExample) } } ```