long
2024-02-04 ae5ea1a3d06324d85f4b04f17bac0dc5572a5a8f
提交 | 用户 | age
3ac5f2 1 // The Vue build version to load with the `import` command
J 2 // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
3
4 // 直接从core-js引入全局的polyfill
aeb317 5 import 'core-js/fn/promise'
3ac5f2 6
J 7 import Vue from 'vue'
aeb317 8 import Element from 'element-ui'
3ac5f2 9 import App from './App'
J 10
11 import router from './router' // 路由表
12 import config from './config' // 域名配置
13 import Axios from './libs/axios'
14 import store from './store'
15 import filter from './filter'
16 import Req from './utils/jun_httpInstall' // http 请求
17 import fn from './utils/g_fn_install'
18
aeb317 19 import 'element-ui/lib/theme-chalk/index.css'
J 20 import 'element-ui/lib/theme-chalk/display.css'
21 import '@/icons' // icon
22
23 Vue.prototype.isTestView = config.isTestView
24
3ac5f2 25 Vue.config.productionTip = false
J 26
27 Vue.config.devtools = config.devtools
28 if (config.ismock) {
29   console.log('%c当前为测试模式,若要切换到线上请先将/src/main.js的ismock设置为0。', 'font-size:2em;font-weight: bold;')
30   require('./mock.js')
31 }
32 Vue.config.productionTip = false
aeb317 33 // 解决elementui下拉搜索框在ios上唤不起软键盘
J 34 import ElementUI from '@/utils/element-ui-preprocessing'
35
36 Vue.use(Element)
37 Vue.use(ElementUI)
3ac5f2 38 Vue.use(Axios)
J 39 Vue.use(filter)
40 Vue.use(Req)
41 Vue.use(fn)
42
c6d315 43 Vue.prototype.$messageSuc = function(msg) {
L 44   this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'success' })
45 }
46 Vue.prototype.$messageWarn = function(msg) {
47   this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'warning' })
48 }
49 Vue.prototype.$messageError = function(msg) {
50   this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'error' })
51 }
52 Vue.prototype.$messageInfo = function(msg) {
53   this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'info' })
54 }
55
3ac5f2 56 /* eslint-disable no-new */
J 57 new Vue({
58   el: '#app',
59   router,
60   store,
61   components: { App },
62   template: '<App/>'
63 })