From ecfe7006e2da521a47a2c4220375cbec68ed0076 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 11 Dec 2020 17:04:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E6=94=AF=E6=8C=81=E9=AB=98=E4=BA=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 1 + ruoyi-ui/src/main.js | 6 +++++- ruoyi-ui/src/views/tool/gen/index.vue | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index f87c17152..f9d07e3cd 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -44,6 +44,7 @@ "element-ui": "2.14.1", "file-saver": "2.0.4", "fuse.js": "6.4.3", + "highlight.js": "10.4.1", "js-beautify": "1.13.0", "js-cookie": "2.2.1", "jsencrypt": "3.0.0-rc.1", diff --git a/ruoyi-ui/src/main.js b/ruoyi-ui/src/main.js index 27539a2af..f8f3980f1 100644 --- a/ruoyi-ui/src/main.js +++ b/ruoyi-ui/src/main.js @@ -18,8 +18,11 @@ import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi"; import Pagination from "@/components/Pagination"; -//自定义表格工具扩展 +// 自定义表格工具扩展 import RightToolbar from "@/components/RightToolbar" +// 代码高亮插件 +import hljs from 'highlight.js' +import 'highlight.js/styles/github-gist.css' // 全局方法挂载 Vue.prototype.getDicts = getDicts @@ -49,6 +52,7 @@ Vue.component('Pagination', Pagination) Vue.component('RightToolbar', RightToolbar) Vue.use(permission) +Vue.use(hljs.vuePlugin); /** * If you don't want to use mock-server diff --git a/ruoyi-ui/src/views/tool/gen/index.vue b/ruoyi-ui/src/views/tool/gen/index.vue index e720a080b..20170e309 100644 --- a/ruoyi-ui/src/views/tool/gen/index.vue +++ b/ruoyi-ui/src/views/tool/gen/index.vue @@ -165,7 +165,7 @@ :name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))" :key="key" > -
{{ value }}
+ @@ -177,6 +177,7 @@ import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen"; import importTable from "./importTable"; import { downLoadZip } from "@/utils/zipdownload"; + export default { name: "Gen", components: { importTable },