main.js
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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)
})