Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuetify 2 isDark issue #603

Closed
cartoonmadrasah opened this issue Aug 12, 2019 · 5 comments
Closed

Vuetify 2 isDark issue #603

cartoonmadrasah opened this issue Aug 12, 2019 · 5 comments

Comments

@cartoonmadrasah
Copy link

Hi. I can't seem to get Vuetify (2.0) on Gridsome (0.6.7) right. I followed the instructions, added vuetify, whitelisted it in the server config and then when I place a test component, I am not seeing any colors:

Image 1

The error in the console shows as:
Error in getter for watcher "isDark": "TypeError: this.$vuetify.theme is undefined".

On build I get this error:
Image 2

I did some research on this issue, and they say I need to wrap in my Default.vue . But when I am wrapping it the screen becomes totally blank.

Image 4

I also suspect it might have to do something with Vuetify 2.0 and Bootstrapping the Vuetify Object but cant seem to make it right.

Image 7

Kindly help and guide. Thank you.

@cartoonmadrasah cartoonmadrasah changed the title Vuetify 2 issue Vuetify 2 isDark issue Aug 12, 2019
@cartoonmadrasah
Copy link
Author

Just checked Vuetify version 1.5.16 works fine but version 2.0.5 breaks (need a solution):
Image 8

@cartoonmadrasah
Copy link
Author

cartoonmadrasah commented Aug 13, 2019

Ok i got it working. Here's what I did:

In Default.vue I added this code:

`<script>
import Vuetify from 'vuetify'

export default {
vuetify: new Vuetify(),
}
</script>`

And for build I added this code to gridsome.server.js:

`const nodeExternals = require('webpack-node-externals');

module.exports = function(api) {
api.chainWebpack((config, { isServer }) => {
if (isServer) {
config.externals([
nodeExternals({
whitelist: [/^Vuetify/,/^vuetify/]
})
]);
}
});
}; `

@0xDaksh
Copy link

0xDaksh commented Dec 18, 2019

I think the right way to do this for vuetify 2 is

main.js

import DefaultLayout from '~/layouts/Default.vue'
import Vuetify from 'vuetify'
import "vuetify/dist/vuetify.min.css"

export default function (Vue, { appOptions }) {
  // Set default layout as a global component
  Vue.use(Vuetify);
  appOptions.vuetify = new Vuetify({});
  Vue.component('Layout', DefaultLayout);
}

layouts/Default.vue

  <v-app>
    <v-content>
      <!-- your code here -->
      <v-container fluid>
        <slot />
      </v-container>
    </v-content>
  </v-app>

@EmmyMay
Copy link

EmmyMay commented Jun 14, 2020

How do you add vuetify to gridsome

@hacknug
Copy link
Member

hacknug commented Jun 23, 2020

How do you add vuetify to gridsome

https://gridsome.org/docs/assets-css/#vuetify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants