Skip to content

Commit

Permalink
docs: update extending the default theme (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
brc-dd committed Sep 5, 2022
1 parent adffb0d commit 8f66b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/guide/theme-introduction.md
Expand Up @@ -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', /* ... */)
}
}
```
Expand Down
5 changes: 3 additions & 2 deletions docs/guide/using-vue.md
Expand Up @@ -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)
}
}
```
Expand Down

0 comments on commit 8f66b42

Please sign in to comment.