main.js 1.8 KB
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import App from './App'
import Vue from 'vue'
import Vuex from 'vuex'
import 'babel-polyfill'

import './third-party/lazy_use'

import router from './router'

if (Number.parseInt === undefined) Number.parseInt = window.parseInt;
if (Number.parseFloat === undefined) Number.parseFloat = window.parseFloat;
import promise from 'es6-promise'
promise.polyfill();

import api from './api'
import store from './newStore'
import recover from './newStore/recover'

// 导入所有过滤器变量
import * as custom from './filters/'

Vue.use(Vuex)

// local js
import './utils/vproto'
import './styles/fonts/iconfont.css'
import './styles/index.css'

import Charts from '@/components/Charts'
import i18n from './assets/i18n/i18n'

import formatOpt from './components/conditions/formatOption'
import storelevel from './components/conditions/storelevelOption'
import exportData from './views/public/exportData'
// import './permission'

Vue.component('export-data-dialog', exportData)
Vue.component('mix-charts', Charts)
Vue.component('format-option-content', formatOpt)
Vue.component('store-level-content', storelevel)

recover.recoverState()

// 全局配置axios
Vue.prototype.$api = api;

Vue.config.productionTip = false;
Vue.config.performance = process.env.NODE_ENV !== 'production';

// 全局过滤器
Object.keys(custom).forEach(key => {
  Vue.filter(key, custom[key]);
});

// 读取配置文件 多项目 默认6.0 平台
document.title = '阅读空间'

Vue.prototype.$Project = 'store'

// 读取配置文件 菜单权限 默认有菜单权限
Vue.prototype.$Menu = window._vionConfig.allMenu || false;

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  template: '<App/>',
  components: { App }
})