Skip to content

Commit f6522e1

Browse files
committed
feat: 给所有 md 文件生成的文档添加代码复制按钮
1 parent c14ac91 commit f6522e1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { install as VueMonacoEditorPlugin } from '@guolao/vue-monaco-editor';
99
import VMdPreview from '@kangc/v-md-editor/lib/preview';
1010
import '@kangc/v-md-editor/lib/style/preview.css';
1111
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
12+
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
13+
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css';
1214
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';
1315
import './css/index.scss';
1416
import './css/element-plus.scss';
@@ -47,6 +49,9 @@ VMdPreview.use(vuepressTheme, {
4749
Prism
4850
});
4951

52+
// copy code
53+
VMdPreview.use(createCopyCodePlugin());
54+
5055
// highlightjs
5156
import 'highlight.js/styles/stackoverflow-light.css';
5257
// import hljs from 'highlight.js/lib/core';

0 commit comments

Comments
 (0)