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

Problems registering Vuetify components in Nuxt (VuetifyLoaderPlugin) #18

Closed
H6LS1S opened this issue Jun 26, 2019 · 1 comment
Closed
Labels
enhancement New feature or request

Comments

@H6LS1S
Copy link
Contributor

H6LS1S commented Jun 26, 2019

Hi, I had problems registering Vuetify components in a bunch of Nuxt ( TypeScript ) + Vuetify ( VuetifyLoaderPlugin ). I was able to solve this, but I'm not sure that this is the easy way. For the most part, this post may be a hint, not a problem, please add this or your method to the documentation. My solution is to re-enforce the registration of some Vuetify components.

Although they are automatically registered, I'm confused :)

Error Example:

[Vue warn]:  Unknown custom element: <v-card> - did you register 
the component correctly? For recursive components, 
make sure to provide the "name" option.

Solution:

//~/plugins/vuetify*

import Vue from 'vue';
import Vuetify, { VTooltip, VToolbar, VCard, VIcon, VBtn } from 'vuetify/lib';
import { TiptapVuetifyPlugin } from 'tiptap-vuetify';

import colors from 'vuetify/es5/util/colors';
import '@mdi/font/css/materialdesignicons.css';
import 'tiptap-vuetify/dist/main.css';

const iconfont = 'mdi';

Vue.use(Vuetify, {
  iconfont: iconfont,
  options: {
    customProperties: true,
  },
  theme: {
    primary: colors.deepPurple.base,
    secondary: colors.purple.darken3,
    accent: colors.pink.darken2,
    error: colors.red.darken4,
    warning: colors.orange.darken4,
    info: colors.blue.base,
    success: colors.green.base,
  },
  components: {
    VTooltip,
    VToolbar,
    VCard,
    VIcon,
    VBtn,
  },
});

Vue.use(TiptapVuetifyPlugin, {
  iconsGroup: iconfont,
});
@iliyaZelenko
Copy link
Owner

iliyaZelenko commented Jun 26, 2019

Thank you very much for finding the problem and showing how to fix it, it is very useful.

It seems VuetifyLoaderPlugin is not working for this library (most likely for all libraries
in node_modules). How you solved the problem is the most obvious way for me.

I added this problem in the README.md so that people find how to solve this problem.

I think I have an idea how to solve this issue at the level of the package itself. Most likely in the future version this error will not occur.

I am also glad that you have no other problems when using this package with Nuxt.js and TypeScript.

Thank you again.

@iliyaZelenko iliyaZelenko changed the title Problems registering Vuetify components in Nuxt Problems registering Vuetify components in Nuxt (VuetifyLoaderPlugin) Jun 26, 2019
@iliyaZelenko iliyaZelenko added the enhancement New feature or request label Jun 26, 2019
iliyaZelenko pushed a commit that referenced this issue Oct 6, 2019
# [2.0.0](v1.7.0...v2.0.0) (2019-10-06)

### Features

* architecture changes ([14b6604](14b6604))
* rewrite plugin, dependency update, small refactor ([f0a5d06](f0a5d06))
* **eslint:** rollback versions for ESLint's tools until they solve the problems with the Vue ([e0a29ef](e0a29ef))
* **extensions, i18n, icons:** rewrite extensions for a new look, news i18n for links, fix icons ([42cdc13](42cdc13))
* **vuetify 2:** rewrote the components for the Vuetify 2. Also other minor changes ([7ac50f3](7ac50f3)), closes [#33](#33) [#29](#29) [#43](#43) [#21](#21) [#18](#18)

### BREAKING CHANGES

* Vuetify version, accces to vuetify via required property in options
* extensions are now used differently
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants