File tree Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Expand file tree Collapse file tree 4 files changed +20
-8
lines changed Original file line number Diff line number Diff line change 12
12
- vue@^2.0
13
13
- webpack@^2.0
14
14
15
- ## Install vue-simplemde
15
+ ## Install
16
16
17
17
``` bash
18
18
npm install vue-simplemde --save
@@ -43,7 +43,7 @@ export default {
43
43
| 属性 | 类型 | 默认值 | 描述 |
44
44
| ----| ----- | ----- | ---- |
45
45
| value | String | 无 | 初始值,可使用v-model绑定 |
46
- | previewClass | String | 无 | 自定义预览样式类 |
46
+ | preview-class | String | 无 | 自定义预览样式类 |
47
47
| autoinit | Boolean | true | 是否自动初始化 |
48
48
| highlight | Boolean | false | 是否开启高亮 |
49
49
| configs | Object | {} | [ SimpleMDE的配置项] ( #configuration ) |
@@ -163,11 +163,24 @@ $ npm install --save github-markdown-css
163
163
```
164
164
165
165
## Highlight
166
+
167
+ ### install
168
+ ```
169
+ $ npm install --save highlight.js
170
+ ```
171
+
172
+ ### use
166
173
``` vue
167
174
<template>
168
175
<markdown-editor :highlight="true"></markdown-editor>
169
176
</template>
170
177
178
+ <script>
179
+ import hljs from 'highlight.js';
180
+
181
+ window.hljs = hljs;
182
+ </script>
183
+
171
184
<style>
172
185
@import '~simplemde/dist/simplemde.min.css';
173
186
@import '~highlight.js/styles/atom-one-dark.css';
@@ -200,7 +213,6 @@ $ npm install --save simplemde-theme-base
200
213
## Dependencies
201
214
202
215
* [ SimpleMDE] ( https://github.com/sparksuite/simplemde-markdown-editor )
203
- * [ Highlight.js] ( https://github.com/isagalaev/highlight.js )
204
216
205
217
## Licence
206
218
Original file line number Diff line number Diff line change 40
40
41
41
<script >
42
42
import markdownEditor from ' vue-simplemde/src/markdown-editor' ;
43
+ import hljs from ' highlight.js' ;
44
+
45
+ window .hljs = hljs;
46
+
43
47
export default {
44
48
name: ' index' ,
45
49
components: {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-simplemde" ,
3
- "version" : " 0.4.2 " ,
3
+ "version" : " 0.4.3 " ,
4
4
"description" : " SimpleMDE - Markdown Editor component for Vue.js" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
17
17
},
18
18
"license" : " MIT" ,
19
19
"dependencies" : {
20
- "highlight.js" : " ^9.12.0" ,
21
20
"simplemde" : " ^1.11.2"
22
21
},
23
22
"repository" : {
Original file line number Diff line number Diff line change @@ -52,9 +52,6 @@ export default {
52
52
// 判断是否开启代码高亮
53
53
if (this .highlight ) {
54
54
configs .renderingConfig .codeSyntaxHighlighting = true ;
55
- import (' highlight.js' ).then ((hljs ) => {
56
- window .hljs = hljs;
57
- });
58
55
}
59
56
60
57
// 实例化编辑器
You can’t perform that action at this time.
0 commit comments