vuetify-module icon indicating copy to clipboard operation
vuetify-module copied to clipboard

Problems with icons and pre-made layouts

Open velidonmez opened this issue 7 years ago • 4 comments

I tried to use one of the pre-made layouts in https://vuetifyjs.com/en/getting-started/pre-made-layouts and encountered this problem:

image

After refreshing page: image

Any idea what causes this problem?

velidonmez avatar Jul 25 '19 13:07 velidonmez

@velidonmez It's cause their predefined Layout uses somehow 3 icon presets at the same time (google material design (md), material design icons (mdi) and font awesome (fa)),. Default one is only mdi- ones so that's why only these are working (see your screenshot).

You need to change the icons of the snippet by mdi- ones to make it work. So it's no an issue for icons, but your document is not defined error seems weird, is it reproducible ? If yes please share a repository with reproduction so I can help you.

kevinmarrec avatar Jul 25 '19 23:07 kevinmarrec

I think this.$vuetify.theme.dark in the created hook causes this problem. You can reproduce it here: https://github.com/velidonmez/vuetify-theme-issue

velidonmez avatar Jul 26 '19 06:07 velidonmez

@velidonmez I think it should be mounted and not created you're looking for, created is called serverSide when using Nuxt universal mode, and toggling this.$vuetify.theme.dark makes Vuetify reactivity calling a method that need access to document, which is something not accessible serverSide.

Furthermore, if you want Vuetify being dark theme by default, you can just do this in your Nuxt configuration file :

vuetify: {
  theme: {
    dark: true
  }
}

kevinmarrec avatar Jul 26 '19 07:07 kevinmarrec

Closing as non reproducible and all is good at : https://codesandbox.io/s/nuxtjs-vuetify-v0k7i (Mdi icons + dark mode toggle working)

kevinmarrec avatar Jul 29 '19 13:07 kevinmarrec