main.js
2.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// 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 Vue from 'vue'
import App from './App'
import router from './router'
import './assets/css/reset.css' // 引入公共样式
// import MintUI from 'mint-ui'
// import 'mint-ui/lib/style.css'
// Vue.use(MintUI) // 引入MintUI
import Mint from 'mint-ui';
import 'mint-ui/lib/style.css'
Vue.use(Mint);
import { MessageBox } from 'mint-ui'
// Vue.use(MessageBox)
Vue.prototype.$msgbox = MessageBox
// import { Indicator } from 'mint-ui';
// Vue.prototype.$Indicator = Indicator
import { Field } from 'mint-ui';
Vue.component(Field.name, Field);
//全局设置的基本样式
import './assets/css/base.scss'
import moment from 'moment'
// 设置本地时区
moment.locale('zh-cn')
Vue.prototype.$moment = moment
import utils from './utils/utils' // 工具类
Vue.prototype.$utils = utils
import common from './utils/common' // 公共
Vue.prototype.$common = common
import variables from './utils/variables' // 公共验证
Vue.prototype.$variables = variables
import {
XHeader,
XInput,
Group,
XButton,
Tabbar,
TabbarItem,
Tab,
TabItem,
Cell,
CellBox,
Checklist,
CheckIcon,
Swiper,
SwiperItem,
Divider,
TransferDom,
Confirm,
Toast,
dateFormat,
Loading,
XDialog
}from 'vux'
Vue.component('x-dialog', XDialog)
Vue.component('loading', Loading)
Vue.component('Toast', Toast)
Vue.component('Confirm', Confirm)
Vue.component('TransferDom', TransferDom)
Vue.component('Divider', Divider)
Vue.component('SwiperItem', SwiperItem)
Vue.component('Swiper', Swiper)
Vue.component('CheckIcon', CheckIcon)
Vue.component('Checklist', Checklist)
Vue.component('Group', Group)
Vue.component('Cell', Cell)
Vue.component('cell-box', CellBox)
Vue.component('x-header', XHeader);
Vue.component('x-input', XInput);
Vue.component('group', Group);
Vue.component('x-button', XButton);
Vue.component('tabbar', Tabbar);
Vue.component('tabbar-item', TabbarItem);
Vue.component('tab', Tab);
Vue.component('tab-item', TabItem);
import { LoadingPlugin } from 'vux'
Vue.use(LoadingPlugin)
import { ToastPlugin } from 'vux'
Vue.use(ToastPlugin)
import { ConfirmPlugin } from 'vux'
Vue.use(ConfirmPlugin)
router.beforeEach((to, from, next) => {
if(to.meta.title){
document.title = to.meta.title
}
next()
})
import 'swiper/dist/css/swiper.min.css' // 轮播
import 'swiper/dist/js/swiper.min'
import vueFilter from './utils/filters' // 公共filter
for (let key in vueFilter){
Vue.filter(key,vueFilter[key])
}
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
components: { App },
template: '<App/>'
})