6

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.

1
  • were you able to solve this? Commented Feb 28, 2019 at 15:19

2 Answers 2

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({});
}

Sign up to request clarification or add additional context in comments.

Comments

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.

For more information see this doc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.