-1
Good afternoon..
I’m having the following error when trying to create a global component with VUEJS..
main.js
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify';
import Menu from '@/components/template/Menu';
Vue.config.productionTip = false
Vue.component = ('app-menu', Menu)
new Vue({
vuetify,
render: h => h(App)
}).$mount('#app')
App.Vue
<template>
<v-app>
<app-menu></app-menu>
<Toolbar />
<v-content>
<Carousel />
</v-content>
<Footer />
</v-app>
</template>
<script>
import Toolbar from "@/components/template/Toolbar";
import Carousel from "@/components/widgets/Carousel";
import Footer from "@/components/template/Footer";
export default {
components: {Toolbar, Carousel, Footer },
};
</script>
ERROR:
[Vue warn]: Unknown custom element: - Did you Register the Component correctly? For recursive Components, make sure to provide the "name" option.
found in
---> at src/App.Vue
Vue.Component = ('app-menu', Menu) switch to Vue.Component('app-menu', Menu) to think that this syntax is incorrect
– Germano Buss Niehues
Thank you very much, that was really the problem.
– Bruno Bafilli
Blz, I’ll answer the question
– Germano Buss Niehues
Only read the documentation: https://br.vuejs.org/v2/guide/components-registration.html
– Giovane