For example, I want to add https://github.com/Akryum/v-tooltip tooltip plugin to my Vuepress project. It asks us to do Vue.use
, not sure how to do that because I get "Vue" is undefined.
Asked
Active
Viewed 1,602 times
6

Boussadjra Brahim
- 82,684
- 19
- 144
- 164

Raja Rao
- 5,691
- 2
- 28
- 31
-
were you able to solve this? – dkaramazov Feb 28 '19 at 15:19
2 Answers
7
What you're trying to do is extend the instance of Vue.
Create an enhanceApp.js file. You will then have access to the instance of Vue that Vuepress is using and be able to extend it.
Here is a link to the doc on the enhanceApp.js file.
Here is an example of bringing in Vuetify.
// .vuepress/enhanceApp.js
import Vuetify from 'vuetify'
export default ({
Vue,
options,
router,
siteData
}) => {
Vue.use(Vuetify)
options.vuetify = new Vuetify({});
}

dkaramazov
- 204
- 2
- 9
1
You can actually install Vue plugins by editing .vuepress/config.js
and passing the plugins
array which can be composed of plugins names or require statements.

TotomInc
- 613
- 1
- 7
- 21