S
S
sergeyviktorovich2020-12-15 19:30:07
Vue.js
sergeyviktorovich, 2020-12-15 19:30:07

Why is there an index.js and main.js file in the vue project, why not just one, what is each of them for?

this is in the index

import Vue from 'vue';
import Vuex from 'vuex';
import createPersistedState from 'vuex-persistedstate';
// import * as Cookies from 'js-cookie';
import dataList from './modules/dataList/dataList';

Vue.use(Vuex);

export default new Vuex.Store({
    modules: {
        dataList,
    },
    strict: true,
    plugins: [
        createPersistedState(),
    ],
});

here it is in maine

import Vue from 'vue';
import axios from 'axios';
import App from './App.vue';
import store from './store';

Vue.prototype.$http = axios;
Vue.config.productionTip = false;

new Vue({
    store,
    axios,
    render: h => h(App),
}).$mount('#app');

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question