Created
April 18, 2019 20:12
-
-
Save webislife/3d5191590c21abc973b491e44bd20711 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue'; | |
import VueRouter from 'vue-router'; | |
import Vuex from 'vuex'; | |
import App from './app.vue'; | |
import { createRouter } from '@client/router.js'; | |
import { createStore } from './store/store.js'; | |
import { sync } from 'vuex-router-sync'; | |
Vue.use(VueRouter); | |
Vue.use(Vuex); | |
//API | |
import {MainApi} from '@client/api/main'; | |
// import global components | |
import IconComponent from '@components/icon.vue';n.vue'; | |
Vue.component('icon', IconComponent); | |
class MyApp { | |
constructor () { | |
/** | |
* @property {Vuex} Store - main application storage | |
*/ | |
this.Store = createStore(); | |
/** | |
* @property {VueRouter} Router - main client application router | |
*/ | |
this.Router = createRouter(); | |
//Синхронизирум хранилище и роутер | |
sync(this.Store, this.Router); | |
/** | |
* @property {Vue} Vue - main vue application | |
*/ | |
this.Vue = new Vue({ | |
router: this.Router, | |
store: this.Store, | |
render: h => h(App), | |
}); | |
/** @property {Object} API main api instance */ | |
this.API = new MainApi(); | |
} | |
} | |
export function createApp () { | |
return new MyApp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment