You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/guide/custom-themes.md
+14
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,20 @@ The compiled content of the current `.md` file being rendered will be available
66
66
</template>
67
67
```
68
68
69
+
## Theme Level Enhancements
70
+
71
+
Themes can extend the Vue app that VuePress uses by exposing an `index.js` file at the root of the theme. 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:
72
+
73
+
```js
74
+
exportdefault ({
75
+
Vue, // the version of Vue being used in the VuePress app
76
+
options, // the options for the root Vue instance
77
+
router // the router instance for the app
78
+
}) => {
79
+
// ...apply enhancements to the app
80
+
}
81
+
```
82
+
69
83
## Using Theme from a Dependency
70
84
71
85
Themes can be published on npm in raw Vue SFC format as `vuepress-theme-xxx`.
0 commit comments