提交 | 用户 | 时间
|
b0367d
|
1 |
import hljs from 'highlight.js' |
H |
2 |
import 'highlight.js/styles/googlecode.css' |
|
3 |
// import 'highlight.js/styles/monokai-sublime.css' |
|
4 |
|
|
5 |
import {createApp} from 'vue' |
|
6 |
import App from './App.vue' |
d36528
|
7 |
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router' |
b0367d
|
8 |
|
H |
9 |
import ElementUI from 'element-plus' |
|
10 |
import 'element-plus/dist/index.css' |
|
11 |
import './assets/scss/base.scss' |
|
12 |
import Antd from 'ant-design-vue'; |
|
13 |
import zhCn from 'element-plus/es/locale/lang/zh-cn' |
|
14 |
import routes from './routes' |
|
15 |
import Vant from 'vant' |
|
16 |
import {createPinia} from 'pinia' |
|
17 |
|
|
18 |
const router = createRouter({ |
d36528
|
19 |
history: createWebHashHistory(), |
b0367d
|
20 |
routes, |
H |
21 |
}); |
|
22 |
|
|
23 |
const app = createApp(App); |
|
24 |
app.config.productionTip = false; |
|
25 |
app.use(Antd) |
|
26 |
app.use(ElementUI, { |
|
27 |
locale: zhCn, |
|
28 |
}); |
|
29 |
app.use(Vant); |
|
30 |
app.use(router); |
|
31 |
app.use(createPinia()); |
|
32 |
app.mount('#app'); |
|
33 |
|
|
34 |
app.directive('highlight', function (el) { |
|
35 |
let blocks = el.querySelectorAll('pre code'); |
|
36 |
blocks.forEach((block) => { |
|
37 |
hljs.highlightBlock(block); |
|
38 |
}); |
|
39 |
}); |