-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
52 lines (44 loc) · 1.16 KB
/
main.js
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
import App from './App'
import Vue from 'vue'
import uView from 'uview-ui'
import moment from 'moment';
import api from "@/common/api"
import config from '@/common/config/env.js'
import store from '@/store/index.js'
import tips from '@/common/util/tips.js'
import ws from '@/common/websocket/ws.js'
import {
router,
RouterMount
} from '@/router'
// 注册全局组件
import navbar from '@/components/navbar/navbar.vue'
import msg from '@/components/msg/msg.vue'
import inputBox from '@/components/inputBox/inputBox.vue'
Vue.component("navbar",navbar)
Vue.component("msg",msg)
Vue.component("inputBox",inputBox)
Vue.config.productionTip = false
Vue.use(router)
Vue.use(uView)
App.mpType = 'app'
moment.locale('zh-cn');
Vue.prototype.$moment = moment;
Vue.prototype.$api = api;
Vue.prototype.$config = config;
Vue.prototype.$tips = tips;
Vue.prototype.$store = store;
Vue.prototype.$ws = ws;
Vue.prototype.$EventBus = new Vue();
const app = new Vue({
store,
...App
})
// uview-request
require('@/common/http/request.js')(app)
// #ifdef H5
RouterMount(app, router, '#app')
// #endif
// #ifndef H5
app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif