Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add vuetify to default vuepress theme

Is it possible to add vuetify to default vuepress theme ?

I just need to add few components to default theme however it would be nice to use the vuetify for handling forms within my components.

I have found a custom vuepress theme which uses a vuetify, however I would prefer to use default vuepress theme.

Another option is to eject the default theme and add the vuetify to it. However I would prefer not to eject the default theme just add vuetify to it.

like image 666
TimB Avatar asked Oct 06 '18 23:10

TimB


1 Answers

The previous answer from oscarteg got me most of the way there. Here's what I had to do for the .vuepress/enhanceApp.js file (and yes, if you do not have one go ahead and create it).

import Vuetify from "vuetify";
import "vuetify/dist/vuetify.min.css";
export default ({
  Vue, // the version of Vue being used in the VuePress app
  options, // the options for the root Vue instance
  router, // the router instance for the app
  siteData // site metadata
}) => {
  Vue.use(Vuetify);
  options.vuetify = new Vuetify({})
};

Note that in the new Vuetify({}) passed to options.vuetify you can set your theming.

See https://github.com/vuejs/vuepress/issues/681#issuecomment-515704018

like image 86
Mike Wright Avatar answered Jan 04 '23 16:01

Mike Wright