From f50b6f4d0efd2b4334769595440baaf6b9c1c173 Mon Sep 17 00:00:00 2001 From: ailanyin Date: Wed, 5 Jul 2023 12:15:25 +0800 Subject: [PATCH] update dep --- package.json | 2 ++ src/main.js | 5 +++++ src/views/tool/gen/index.vue | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0bc321b..077ce3d 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ }, "dependencies": { "@element-plus/icons-vue": "2.0.10", + "@highlightjs/vue-plugin": "^2.1.0", "@vueup/vue-quill": "1.1.0", "@vueuse/core": "9.5.0", "axios": "0.27.2", @@ -24,6 +25,7 @@ "element-plus": "2.2.27", "file-saver": "2.0.5", "fuse.js": "6.6.2", + "highlight.js": "^11.8.0", "js-cookie": "3.0.1", "jsencrypt": "3.3.1", "lodash-es": "^4.17.21", diff --git a/src/main.js b/src/main.js index 38c0ea4..d46b5bf 100644 --- a/src/main.js +++ b/src/main.js @@ -2,6 +2,10 @@ import { createApp } from "vue"; import Cookies from "js-cookie"; +import "highlight.js/styles/atom-one-light.css"; +import "highlight.js/lib/common"; +import hljsVuePlugin from "@highlightjs/vue-plugin"; + import ElementPlus from "element-plus"; import locale from "element-plus/lib/locale/lang/zh-cn"; // 中文语言 import "@/assets/styles/index.scss"; // global css @@ -70,6 +74,7 @@ app.use(router); app.use(store); app.use(plugins); app.use(elementIcons); +app.use(hljsVuePlugin); app.component("svg-icon", SvgIcon); directive(app); diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index 2d8a6c9..cb76eee 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -205,7 +205,7 @@ style="float: right" > 复制 -
{{ value }}
+