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

53 lines
1.2 KiB
JavaScript
Raw Normal View History

2019-07-04 10:59:40 +08:00
import Vue from 'vue';
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import 'normalize.css/normalize.css'; // A modern alternative to CSS resets
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
2019-07-02 16:29:52 +08:00
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
2019-07-04 10:59:40 +08:00
import '@/styles/index.scss'; // global css
2019-07-02 16:29:52 +08:00
2019-08-08 11:29:03 +08:00
import LangStorage from '@/utils/lang';
2019-07-04 10:59:40 +08:00
import App from './App';
2019-08-08 11:29:03 +08:00
import VueI18n from 'vue-i18n';
2019-07-04 10:59:40 +08:00
import store from './store';
import router from './router';
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
import '@/icons'; // icon
import '@/permission'; // permission control
import '@/scripts/GlobalPlugin';
2019-07-26 13:32:43 +08:00
import '@/directives';
2019-08-08 11:29:03 +08:00
import messages from '@/i18n/index';
2019-07-04 10:59:40 +08:00
Vue.use(ElementUI);
2019-08-08 11:29:03 +08:00
Vue.use(VueI18n);
2019-07-02 16:29:52 +08:00
2019-07-04 10:59:40 +08:00
Vue.config.productionTip = false;
2019-07-02 16:29:52 +08:00
2019-08-08 11:29:03 +08:00
const i18n = new VueI18n({
locale: LangStorage.getLang('zh'),
messages
});
2019-08-02 14:54:51 +08:00
new Vue({
2019-07-02 16:29:52 +08:00
el: '#app',
router,
store,
2019-08-08 11:29:03 +08:00
i18n,
2019-07-02 16:29:52 +08:00
render: h => h(App)
2019-07-04 10:59:40 +08:00
});
2019-07-02 16:29:52 +08:00
router.beforeEach((to, from, next) => {
2019-07-04 10:59:40 +08:00
const name = to.fullPath;
2019-07-02 16:29:52 +08:00
if (name.includes('/dp/') || name.includes('display/dp')) {
document.title = '琏课堂-大屏系统';
} else if (name.includes('/plan/') || name.includes('/planEdit/')) {
document.title = '琏计划';
} else {
document.title = '琏课堂';
}
next();
});