vuejs / vitepress

Vite & Vue powered static site generator.
https://vitepress.dev
MIT License
11.95k stars 1.94k forks source link

How to inherit theme #2102

Closed fjun99 closed 1 year ago

fjun99 commented 1 year ago

How to do theme inheritance like VuePress in VitePress

VuePress docs: https://vuepress.vuejs.org/theme/inheritance.html

I would like to inherit the theme-default and change some component.

Thanks.

brc-dd commented 1 year ago

https://vitepress.dev/guide/extending-default-theme

fjun99 commented 1 year ago

https://vitepress.dev/guide/extending-default-theme#extending-the-default-theme

Thanks. Have read this docs and still have no idea how to modify.

1) case 1: add components. Done

    // register your custom global components
    ctx.app.component('MyComp',MyComp /* ... */)

2) case 2: still have problem

How to modify some parts of VPDoc by inherit it.

How to add layouts other than doc, page, and home