docs: update extending the default theme (#1288)

pull/1290/head
Divyansh Singh 2 years ago committed by GitHub
parent adffb0d617
commit 8f66b42a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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', /* ... */)
}
}
```

@ -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)
}
}
```

Loading…
Cancel
Save