vuex-router-sync
- vue 管理视图的
- vuex 管理数据元
- vuex-router-sync 是链接vuex和vue-router
//引入库
import Vue from 'vue'
import axios from 'axios'
import { sync } from 'vuex-router-sync'
//引入本地文件
import App from './App'
import router from './router'
import store from './store'
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
Vue.http = Vue.prototype.$http = axios
Vue.config.productionTip = false
//链接vuex和vue-router
sync(store,router)
new Vue({
components: { App },
router,
store,
template: '<App/>'
}).$mount('#app')
export { router, store }