This commit is contained in:
gexinzhineng/gxzn27
2023-01-29 14:46:08 +08:00
parent 2be0ea5ffb
commit 3b9fe77036
3 changed files with 27 additions and 21 deletions

View File

@@ -49,6 +49,9 @@ import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
import hljs from 'highlight.js' //导入代码高亮文件
import 'highlight.js/styles/github-gist.css' //导入代码高亮样式
// 本地开发模式 全局引入 element-plus 样式,加快第一次进入速度
if (isDevMode()) {
console.info(isDevMode())
@@ -59,6 +62,14 @@ if (isDevMode()) {
const setupAll = async () => {
const app = createApp(App)
//自定义一个代码高亮指令
app.directive('highlight', function (el) {
const blocks = el.querySelectorAll('code')
blocks.forEach((block: any) => {
hljs.highlightBlock(block)
})
})
await setupI18n(app)
MyPD(app)