docs: always use 'extends' to extend themes (#3181)

pull/3187/head
skirtle 1 year ago committed by GitHub
parent a850786a56
commit 2cc0acceef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -135,7 +135,7 @@ import DefaultTheme from 'vitepress/theme'
import MyLayout from './MyLayout.vue'
export default {
...DefaultTheme,
extends: DefaultTheme,
// override the Layout with a wrapper component that
// injects the slots
Layout: MyLayout
@ -168,7 +168,7 @@ import DefaultTheme from 'vitepress/theme'
import MyComponent from './MyComponent.vue'
export default {
...DefaultTheme,
extends: DefaultTheme,
Layout() {
return h(DefaultTheme.Layout, null, {
'aside-outline-before': () => h(MyComponent)

@ -82,7 +82,7 @@ However, VitePress won't redirect `/` to `/en/` by default. You'll need to confi
import DefaultTheme from 'vitepress/theme'
export default {
...DefaultTheme,
extends: DefaultTheme,
setup() {
const { lang } = useData()
watchEffect(() => {

Loading…
Cancel
Save