Using a theme

Using a theme is almost the same as using a plugin.

Using a theme from a dependency

Themes can be published on npm in raw Vue SFC format as vuepress-theme-xxx.

  1. module.exports = {
  2. theme: 'vuepress-theme-xx'
  3. }

Theme Shorthand

If you prefix the theme with vuepress-theme-, you can use a shorthand to leave out that prefix:

  1. module.exports = {
  2. theme: 'xxx'
  3. }

Same with:

  1. module.exports = {
  2. theme: 'vuepress-theme-xxx'
  3. }

This also works with Scoped PackagesUsing a theme - 图1:

  1. module.exports = {
  2. theme: '@org/vuepress-theme-xxx', // or an official theme: '@vuepress/theme-xxx'
  3. }

Shorthand:

  1. module.exports = {
  2. theme: '@org/xxx', // or an official theme: '@vuepress/xxx'
  3. }

Note

The theme whose name starts with @vuepress/theme- is an officially maintained theme.