mirror of
https://gitee.com/hhyykk/ipms-sjy-ui.git
synced 2025-07-14 10:55:06 +08:00
将 highlight 代码高亮的全局引入,改成局部引入
This commit is contained in:
11
src/main.ts
11
src/main.ts
@ -37,9 +37,6 @@ import App from './App.vue'
|
||||
|
||||
import './permission'
|
||||
|
||||
import hljs from 'highlight.js' //导入代码高亮文件
|
||||
import 'highlight.js/styles/github.css' //导入代码高亮样式 新版
|
||||
|
||||
import '@/plugins/tongji' // 百度统计
|
||||
|
||||
import Logger from '@/utils/Logger'
|
||||
@ -48,14 +45,6 @@ import Logger from '@/utils/Logger'
|
||||
const setupAll = async () => {
|
||||
const app = createApp(App)
|
||||
|
||||
//自定义一个代码高亮指令
|
||||
app.directive('highlight', function (el) {
|
||||
const blocks = el.querySelectorAll('code')
|
||||
blocks.forEach((block: any) => {
|
||||
hljs.highlightElement(block)
|
||||
})
|
||||
})
|
||||
|
||||
await setupI18n(app)
|
||||
|
||||
setupStore(app)
|
||||
|
Reference in New Issue
Block a user