2019-07-04 21:52:39 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
import ElementUI from 'element-ui'
|
|
|
|
|
import 'element-ui/lib/theme-chalk/index.css'
|
|
|
|
|
import App from './App.vue'
|
|
|
|
|
|
|
|
|
|
import VueRouter from 'vue-router'
|
|
|
|
|
import routes from './routes'
|
2020-05-03 09:21:28 +08:00
|
|
|
import store from './store/index'
|
2019-07-04 21:52:39 +08:00
|
|
|
import axios from 'axios'
|
|
|
|
|
import VueAxios from 'vue-axios'
|
|
|
|
|
|
2020-05-11 22:37:30 +08:00
|
|
|
import vueHljs from "vue-hljs";
|
|
|
|
|
import "vue-hljs/dist/vue-hljs.min.css";
|
|
|
|
|
|
2019-07-04 21:52:39 +08:00
|
|
|
Vue.use(ElementUI);
|
|
|
|
|
Vue.use(VueRouter);
|
|
|
|
|
Vue.use(VueAxios, axios);
|
2020-05-11 22:37:30 +08:00
|
|
|
Vue.use(vueHljs);
|
2019-07-04 21:52:39 +08:00
|
|
|
|
|
|
|
|
// 公用方法
|
2020-05-03 09:21:28 +08:00
|
|
|
Vue.prototype.$store = store;
|
2019-07-04 21:52:39 +08:00
|
|
|
|
|
|
|
|
const router = new VueRouter({routes});
|
|
|
|
|
// 路由跳转时判断处理
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
2020-05-23 12:21:23 +08:00
|
|
|
if (to.meta.title) {
|
|
|
|
|
document.title = to.meta.title;
|
|
|
|
|
}
|
|
|
|
|
store.commit('global/setFullscreen', !!to.meta.fullscreen);
|
|
|
|
|
next();
|
2019-07-04 21:52:39 +08:00
|
|
|
});
|
|
|
|
|
|
2020-05-23 12:21:23 +08:00
|
|
|
let vue = new Vue({
|
2019-07-04 21:52:39 +08:00
|
|
|
el: '#app',
|
|
|
|
|
router,
|
|
|
|
|
render(h) {
|
2020-05-23 12:21:23 +08:00
|
|
|
return h(App);
|
2019-07-04 21:52:39 +08:00
|
|
|
}
|
|
|
|
|
});
|
2020-05-23 12:21:23 +08:00
|
|
|
export default vue;
|
2019-07-04 21:52:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|