rt-sim-training-client/src/main.js

56 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-07-02 16:29:52 +08:00
import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import '@/icons' // icon
import '@/permission' // permission control
import '@/scripts/GlobalPlugin'
Vue.use(ElementUI)
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
router.beforeEach((to, from, next) => {
let name = to.fullPath;
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});
Vue.prototype.$messageBox = function (msge) {
if (this.$confirm) {
this.$confirm(`${msge || '处理失败'}`, '提示', {
confirmButtonText: '确定',
type: 'warning',
showCancelButton: false,
center: true
}).then(() => {
}).catch(() => {
});
}
};