File tree Expand file tree Collapse file tree 4 files changed +80
-0
lines changed Expand file tree Collapse file tree 4 files changed +80
-0
lines changed Original file line number Diff line number Diff line change 1+ <template >
2+ <v-md-editor
3+ v-model =" text"
4+ height =" 500px"
5+ />
6+ </template >
7+
8+ <script >
9+ import VMdEditor from ' ../../../lib/base-editor' ;
10+ import ' ../../../lib/style/base-editor.css' ;
11+ import githubTheme from ' ../../../lib/theme/github.js' ;
12+ import ' ../../../lib/theme/style/github.css' ;
13+ import createAlignPlugin from ' ../../../lib/plugins/align/index' ;
14+
15+ import hljs from ' highlight.js' ;
16+
17+ const text = ` ::: align-left
18+ left
19+ :::
20+
21+ ::: align-center
22+ center
23+ :::
24+
25+ ::: align-right
26+ right
27+ :::
28+ ` ;
29+
30+ export default {
31+ created () {
32+ VMdEditor .use (createAlignPlugin ());
33+ VMdEditor .use (githubTheme, {
34+ Hljs: hljs,
35+ });
36+ },
37+ components: {
38+ [VMdEditor .name ]: VMdEditor,
39+ },
40+ data () {
41+ return {
42+ text,
43+ };
44+ },
45+ };
46+ </script >
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ module.exports = {
7474 [ '/plugins/line-number' , 'Line Number' ] ,
7575 [ '/plugins/highlight-lines' , 'Highlight Lines' ] ,
7676 [ '/plugins/copy-code' , 'Copy Code' ] ,
77+ [ '/plugins/align' , 'Align' ] ,
7778 ] ,
7879 } ,
7980 ] ,
@@ -138,6 +139,7 @@ module.exports = {
138139 [ '/zh/plugins/line-number' , '代码行号' ] ,
139140 [ '/zh/plugins/highlight-lines' , '高亮代码行' ] ,
140141 [ '/zh/plugins/copy-code' , '快捷复制代码' ] ,
142+ [ '/plugins/align' , '内容定位' ] ,
141143 ] ,
142144 } ,
143145 ] ,
Original file line number Diff line number Diff line change 1+ # Align Plugin
2+
3+ The ` align ` plugin can be introduced to support setting the horizontal position of the content:
4+
5+ <ClientOnly >
6+ <plugin-align />
7+ </ClientOnly >
8+
9+ ### Import:
10+
11+ ``` js
12+ import VueMarkdownEditor from ' @kangc/v-md-editor' ;
13+ import createAlignPlugin from ' @kangc/v-md-editor/lib/plugins/align' ;
14+
15+ VueMarkdownEditor .use (createAlignPlugin ());
16+ ```
Original file line number Diff line number Diff line change 1+ # Align 内容定位
2+
3+ 可以引入 ` align ` 插件来支持设置内容的水平位置:
4+
5+ <ClientOnly >
6+ <plugin-align />
7+ </ClientOnly >
8+
9+ ### 引入:
10+
11+ ``` js
12+ import VueMarkdownEditor from ' @kangc/v-md-editor' ;
13+ import createAlignPlugin from ' @kangc/v-md-editor/lib/plugins/align' ;
14+
15+ VueMarkdownEditor .use (createAlignPlugin ());
16+ ```
You can’t perform that action at this time.
0 commit comments