Answer the question
In order to leave comments, you need to log in
How can I make the connection of components in one file?
How can I not write global components in main. Drive them into one fight and through import drive everything into main.js
How main.js is implemented
now
import Vue from 'vue'
import router from './router'
import headImplant from './components/header/head.vue'
import footer from './components/footer/foot.vue'
import sidebar from './components/menu/sidebar.vue'
import store from './store'
import Modal from './components/modal/modal.vue';
window.eventBus = new Vue(); // события
window.Vue = Vue;
window.store = store;
Vue.component('modal',Modal);//Тут возможно будут еще компоненты
new Vue({
el: '#app',
router: router,
store,
components: {
'head-app': headImplant,
'footer-app': footer,
'sidebar-app': sidebar
}
});
import Vue from "vue/types/vue";
import Modal from './components/modal/modal.vue';
Vue.component('modal',Modal);
// import component from './components'
Answer the question
In order to leave comments, you need to log in
components
import Modal from './modal';//Vue
export default {
Modal,
}
import component from './components'
new Vue({
el: '#app',
router: router,
store,
components
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question