main.js 1.28 KB
import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
// import '@/permission' // permission control


import {
  httpGet,
  httpPost,
  httpDelete,
  httpFormdata,
  getHeaders,
  downloadExcel
} from '@/api/fetch-api-new.js'


/**
 * This project originally used easy-mock to simulate data,
 * but its official service is very unstable,
 * and you can build your own service if you need it.
 * So here I use Mock.js for local emulation,
 * it will intercept your request, so you won't see the request in the network.
 * If you remove `../mock` it will automatically request easy-mock data.
 */
// import '../mock' // simulation data

Vue.use(ElementUI)

Vue.config.productionTip = false


// 配置api
let api = require('@/api/api');
// 挂载全局app
app.api = api;
app.get = httpGet;
app.post = httpPost;
app.delete = httpDelete;
app.form = httpFormdata;
app.headers = getHeaders;
app.downloadExcel = downloadExcel;
app.router = router;
window.app = app;

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})