2
正在使用vuetify建立一個模板,但我得到一個錯誤Vuetifyjs錯誤未知的自定義元素:你註冊的組件正確
unknown custom element dashboard did you register the component correctly?
這是我的代碼:
In the main.js
import Vue from 'vue'
import App from './App.vue'
import Vuetify from 'vuetify'
import VueRouter from 'vue-router';
import {routes} from './routes';
Vue.use(VueRouter);
Vue.use(Vuetify)
new Vue({
el: '#app',
render: h => h(App)
})
在我的應用程序。 VUE
<template>
<dashboard></dashboard>
</template>
<script>
import Dashbaord from './components/dashboard/Dashboard.vue';
export default {
name: "appinit",
components: {
"dashboard":Dashboard
}
}
這裏是我的儀表盤
<template>
<v-app>
<left-drawer></left-drawer>
<toolbar></toolbar> <!-- Dashboard Toolbar-->
<main>
<v-container fluid>
..info are
</v-slide-y-transition>
</v-container>
</main>
<right-drawer></right-drawer>
<footer-area></footer-area>
</v-app>
</template>
<script>
imports ......
export default {
components: {
Toolbar, RightDrawer,LeftDrawer,FooterArea
}
}
可能是錯的是什麼,因爲我剛纔分離初始vuefy安裝組件成不同的組件部分
的代碼可以在GitHub上的This link
出了什麼問題?
我不知道你在哪裏註冊儀表板組件。查看他們的https://vuejs.org/v2/guide/components.html#Registration – C0d1ngJammer
我已將註冊的儀表板作爲AppVue組件的本地組件,檢查組件:{} area –
,如下所示:https: //vuejs.org/v2/guide/components.html#Local-Registration –