import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './styles/global.scss'

Vue.use(ElementUI)
Vue.config.productionTip = false

Vue.prototype.msgSuccess = function (msg) {
  this.$message({ showClose: true, message: msg, type: "success", offset:100 });
}
Vue.prototype.msgError = function (msg) {
  this.$message({ showClose: true, message: msg, type: "error", offset:100 });
}
// 接口错误已由 request.js 拦截器统一用 Message.error 提示
// 阻止未处理的 Promise rejection 触发浏览器/webpack 的全屏错误遮罩
window.addEventListener('unhandledrejection', event => {
  event.preventDefault()
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
