未知的自定义元素:<v-app>- 您是否正确注册了组件?对于递归组件 [英] Unknown custom element: <v-app> - did you register the component correctly? For recursive components

查看:62
本文介绍了未知的自定义元素:<v-app>- 您是否正确注册了组件?对于递归组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我在将 vuetify 导入我的项目时遇到问题...

Hey I have a problem with importing vuetify into my project...

我做错了什么?

[Vue 警告]:未知的自定义元素:-您是否注册了组件正确吗?对于递归组件,请确保提供名称"选项.

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

app.js:

import Vue from "vue";
import Vuetify from "./plugins/vuetify";
import store from "~/store";
import router from "~/router";

import App from "~/components/App";

Vue.config.productionTip = false;

/* eslint-disable no-new */
new Vue({
    store,
    router,
    Vuetify,
    ...App
});

App.vue:

<template>
  <v-app>
    <loading ref="loading" />
    <router-view />
  </v-app>
</template>

<script>
import Loading from "./Loading";

export default {
  el: "#app",
  components: {
    Loading
  }
};
</script>

<style>
</style>

plugins/vuetify.js:

import Vue from "vue";
import Vuetify from "vuetify/lib";

Vue.use(Vuetify);

export default new Vuetify({
    icons: {
        iconfont: "md" // 'mdi' || 'mdiSvg' || 'md' || 'fa' || 'fa4'
    },
    theme: {
        dark: false
    },
    themes: {
        light: {
            primary: "#4682b4",
            secondary: "#b0bec5",
            accent: "#8c9eff",
            error: "#b71c1c"
        }
    }
});

推荐答案

遇到了同样的问题,现在困扰了我一个小时,这是如何工作的我也不知道:但这是我在导入时更改的内容vuetify.js

Had the same issue which has bugged my head for like an hour now, how this worked I don't know either: but this is what I changed when importing vuetify in vuetify.js

改变:

从'vuetify/lib'导入Vuetify

替换为:

从'vuetify'导入Vuetify

注意:这可能是 Laravel 问题,因为官方 vuetify 文档具有第一种形式.

Note: this could be a laravel issue only because the official vuetify documentation has the first form.

这篇关于未知的自定义元素:&lt;v-app&gt;- 您是否正确注册了组件?对于递归组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆