vuepress-theme-plume/docs/en/guide/custom/component-overrides.md
pengzhanbo 385059f214
docs: update en docs (#708)
* docs: update en docs

* chore: tweak

* chore: tweak

* chore: tweak
2025-10-09 15:46:05 +08:00

1.4 KiB

title, icon, createTime, permalink
title icon createTime permalink
Component Overrides carbon:cics-sit-overrides 2025/10/08 16:20:15 /en/guide/component-overrides/

Overview

Layout slots are quite practical, but sometimes you might find them not flexible enough. The theme also provides the capability to override individual components.

::: warning Before using this feature, you should first familiarize yourself with this theme's source code and understand the various built-in components to safely override them.

The theme's component source code is hosted on GitHub under the MIT license. :::

Usage

The theme registers all non-global components with an alias prefixed with @theme. For example, the alias for VPFooter.vue is @theme/VPFooter.vue.

If you want to override the VPFooter.vue component, you simply need to override this alias in the configuration file .vuepress/config.ts:

import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'
import { getDirname, path } from 'vuepress/utils'

const __dirname = getDirname(import.meta.url)

export default defineUserConfig({
  theme: plumeTheme(),

  alias: {
    '@theme/VPFooter.vue': path.resolve(
      __dirname,
      './components/MyFooter.vue',
    ),
  },
})