-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
46 lines (38 loc) · 1.28 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios';
import Vue from 'vue';
import VueRouter from 'vue-router';
import Pc from './pc';
import router from './router'
import 'element-ui/lib/theme-chalk/display.css';//引入element-ui隐藏类
import commonFucntion from '@/assets/js/fn/function';//引入自定义全局方法
import * as commonFilter from '@/assets/js/filter';//引入全局过滤器
import language from '@/assets/js/language';//引入全局变量
import hljs from 'highlight.js';//引入高亮
import 'highlight.js/styles/googlecode.css';//引入高亮样式
//全局注册
Vue.config.productionTip = false;
Vue.use(VueRouter);
Vue.use(ElementUI);
Vue.use(commonFucntion);
Vue.use(commonFilter);
Vue.prototype.axios = axios;
Vue.prototype.text = language;
Vue.directive('highlight', (el) => {
let blocks = el.querySelectorAll('pre code')
blocks.forEach((block) => {
hljs.highlightBlock(block)
})
});
/* 创建挂载点至#app元素,将内容显示在index.html页面 */
let pc = new Vue({
el: '#pc',
router,
axios,
// instance,
render: h => h(Pc)
})
Vue.use({pc})