-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.ts
66 lines (49 loc) · 1.62 KB
/
main.ts
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import {createApp} from 'vue'
import App from './App.vue'
//[Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive.
import 'default-passive-events'
const app = createApp(App);
// import { Quasar } from 'quasar'
// @ts-ignore
import {Quasar} from 'quasar/dist/quasar.esm.prod'
import '@quasar/extras/material-icons/material-icons.css'
import 'quasar/src/css/index.sass'
app.use(Quasar, {
plugins: [],
})
// highlight 的样式,依赖包,组件
import hljs from 'highlight.js';
import 'highlight.js/styles/github.css' //导入代码高亮样式
//@ts-ignore
import {lineNumbersBlock} from "./util/highlight-line-number";
//@ts-ignore
import CopyButtonPlugin from './util/highlightjs-copy'
hljs.configure({
//关闭xss攻击的警告(存在未转义的HTML标签)
ignoreUnescapedHTML: true
})
hljs.addPlugin(new CopyButtonPlugin({}));
app.directive('hljs', el => {
let blocks = el.querySelectorAll('pre code');
blocks.forEach((block: any) => {
if (block.getAttribute("highlighted") == "true") {
return
}
block.setAttribute("highlighted", "true")
hljs.highlightElement(block)
lineNumbersBlock(block)
})
});
const {shell} = require('electron');
//@ts-ignore
window.openExternal = (url: string) => {
shell.openExternal(url);
}
import store from './store'
import instance from "@/util/api";
app.config.globalProperties.$axios = instance
app.use(store)
app.mount('#app')
.$nextTick(() => {
postMessage({payload: 'removeLoading'}, '*')
})