Skip to content

Commit 686d3d1

Browse files
committed
docs: document enhanceApp.js
1 parent 40ca73c commit 686d3d1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/guide/basic-config.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@ Consult the [Config Reference](../config/) for a full list of options.
2222
A VuePress theme is responsible for all the layout and interactivity details of your site. VuePress ships with a default theme (you are looking at it right now) which is designed for technical documentation. It exposes a number of options that allow you to customize the navbar, sidebar and homepage, etc. For details, check out the [Default Theme Config](../default-theme-config/) page.
2323

2424
If you wish to develop a custom theme, see [Custom Themes](./custom-themes.md).
25+
26+
## App Level Enhancements
27+
28+
Since the VuePress app is a standard Vue app, you can apply app-level enhancements by creating a file `.vuepress/enhanceApp.js`, which will be imported into the app if it is present. The file should `export default` a hook function which will receive an object containing some app level values. You can use this hook to install additional Vue plugins, register global components, or add additional router hooks:
29+
30+
``` js
31+
export default ({
32+
Vue, // the version of Vue being used in the VuePress app
33+
options, // the options for the root Vue instance
34+
router // the router instance for the app
35+
}) => {
36+
// ...apply enhancements to the app
37+
}
38+
```

0 commit comments

Comments
 (0)