From 5179e6407d99072f571bc1d0c159854e39d97160 Mon Sep 17 00:00:00 2001 From: lyc Date: Thu, 9 Jan 2025 15:16:34 +0800 Subject: [PATCH] =?UTF-8?q?edit=20=E6=A1=86=E6=9E=B6=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/renderer/src/main.js | 14 +++ .../views/teachingDesign/container/center.vue | 116 ++++++++++-------- .../src/views/teachingDesign/index.vue | 4 +- 4 files changed, 79 insertions(+), 56 deletions(-) diff --git a/package.json b/package.json index 7fb23eb..ea23159 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@electron/remote": "^2.1.2", "@element-plus/icons-vue": "^2.3.1", "@icon-park/vue-next": "^1.4.2", + "@kangc/v-md-editor": "^2.3.18", "@tinymce/tinymce-vue": "5.1.1", "@vitejs/plugin-vue-jsx": "^4.0.0", "@vue-office/docx": "^1.6.2", diff --git a/src/renderer/src/main.js b/src/renderer/src/main.js index a723b75..76763e7 100644 --- a/src/renderer/src/main.js +++ b/src/renderer/src/main.js @@ -10,6 +10,15 @@ import './assets/iconfont/iconfont' import 'virtual:windi.css' import request from "@/utils/request"; +//v-md-editor +import VMdPreview from '@kangc/v-md-editor/lib/preview'; +import '@kangc/v-md-editor/lib/style/preview.css'; +// 引入你所使用的主题 此处以 github 主题为例 +import githubTheme from '@kangc/v-md-editor/lib/theme/github'; +import '@kangc/v-md-editor/lib/theme/style/github.css'; +// highlightjs +import hljs from 'highlight.js'; + import { store } from '@/store' import App from './App.vue' import router from './router' @@ -39,6 +48,10 @@ app.config.globalProperties.$requestGetJYW = (url,config)=>{ import Icon from '@/AixPPTist/src/plugins/icon' import Directive from '@/AixPPTist/src/plugins/directive' +VMdPreview.use(githubTheme, { + Hljs: hljs, +}); + app.use(router) .use(store) .use(ElementPlus, { locale: zhLocale }) @@ -46,6 +59,7 @@ app.use(router) .use(plugins) .use(Icon) .use(Directive) + .use(VMdPreview) .mount('#app') const isStadium = (user) => { diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index 30f78d6..f76370e 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -16,7 +16,10 @@
-