未知的自定义元素:<v-main> Vuetify

时间:2020-08-20 15:54:03

标签: vue.js vuetify.js

我收到错误消息Unknown custom element: <v-main> - did you register the component correctly?
但是其他所有Vuetify标签(v-app,v-app-bar等)都可以正常工作

我正在使用VueJS + Vuetify + Laravel
package.json

"vue": "^2.5.17",
"vuetify": "^2.2.30",
"vuex": "^3.4.0"
"vuetify-loader": "^1.3.0"
"vue-cli-plugin-vuetify": "~2.0.5",
"vue-template-compiler": "^2.6.10",

app.js中:

import Vuetify from "vuetify";
Vue.use(Vuetify);
Vue.component('main-app', require("./MainApp").default);
const app = new Vue({
    el: "#app",
    store,
    vuetify: new Vuetify(),
});

组件:

<template>
    <v-app>
        <v-main>
        </v-main>
    </v-app>
</template>

.blade.php文件:

<body>
<div id="app">
    <main-app></main-app>
</div>
</body>

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

通过将Vuetify更新为"vuetify": "^2.3.9",

解决的问题