// The Vue build version to load with the `import` command // (runtime-only or standalone) has been set in webpack.base.conf with an alias. // 直接从core-js引入全局的polyfill import 'core-js/fn/promise' import Vue from 'vue' import Element from 'element-ui' import App from './App' import router from './router' // 路由表 import config from './config' // 域名配置 import Axios from './libs/axios' import store from './store' import filter from './filter' import Req from './utils/jun_httpInstall' // http 请求 import fn from './utils/g_fn_install' import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/display.css' import '@/icons' // icon // 全局标题图标配置!!! import settingConfig from './config/settingConfig' // 全局标题图标配置 Vue.prototype.settingConfig = settingConfig Vue.prototype.isTestView = config.isTestView Vue.config.productionTip = false Vue.config.devtools = config.devtools if (config.ismock) { console.log('%c当前为测试模式,若要切换到线上请先将/src/main.js的ismock设置为0。', 'font-size:2em;font-weight: bold;') require('./mock.js') } Vue.config.productionTip = false // 解决elementui下拉搜索框在ios上唤不起软键盘 import ElementUI from '@/utils/element-ui-preprocessing' Vue.use(Element) Vue.use(ElementUI) Vue.use(Axios) Vue.use(filter) Vue.use(Req) Vue.use(fn) Vue.prototype.$messageSuc = function(msg) { this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'success' }) } Vue.prototype.$messageWarn = function(msg) { this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'warning' }) } Vue.prototype.$messageError = function(msg) { this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'error' }) } Vue.prototype.$messageInfo = function(msg) { this.$message({ message: msg, dangerouslyUseHTMLString: true, type: 'info' }) } /* eslint-disable no-new */ new Vue({ el: '#app', router, store, components: { App }, template: '' })