File tree Expand file tree Collapse file tree 1 file changed +22
-19
lines changed Expand file tree Collapse file tree 1 file changed +22
-19
lines changed Original file line number Diff line number Diff line change @@ -25,15 +25,15 @@ npm install vue-codemirror --save
25
25
### Vue use
26
26
27
27
``` javascript
28
- ## import with ES6
28
+ // import with ES6
29
29
import Vue from ' vue'
30
- ...
30
+ // ...
31
31
import CodeMirror from ' vue-codemirror'
32
32
33
33
34
- ## require with Webpack
34
+ // require with Webpack
35
35
var Vue = require (' vue' )
36
- ...
36
+ // ...
37
37
var CodeMirror = require (' vue-codemirror' )
38
38
39
39
@@ -48,33 +48,36 @@ Vue.use(CodeMirror)
48
48
<codemirror ></codemirror >
49
49
50
50
51
- # component data bind
51
+ <!-- component data bind -->
52
52
<codemirror :code.sync =" code" ></codemirror >
53
53
54
54
55
- # component config example 1
55
+ <!-- component config example 1 -->
56
56
<codemirror :code.sync =" code" :options =" editorOption" ></codemirror >
57
57
```
58
58
59
59
60
60
``` javascript
61
- # editorOption example:
62
- data () {
63
- return {
64
- code: ' const a = 10' ,
65
- editorOption: {
66
- tabSize: 4 ,
67
- mode: ' text/javascript' ,
68
- theme: ' base16-dark' ,
69
- lineNumbers: true ,
70
- line: true ,
71
- ...
61
+ // editorOption example:
62
+ export default {
63
+ data () {
64
+ return {
65
+ code: ' const a = 10' ,
66
+ editorOption: {
67
+ tabSize: 4 ,
68
+ mode: ' text/javascript' ,
69
+ theme: ' base16-dark' ,
70
+ lineNumbers: true ,
71
+ line: true ,
72
+ ...
73
+ }
72
74
}
73
75
}
74
76
}
75
77
76
78
77
- # editorOption mode types:
79
+ // editorOption mode types:
80
+
78
81
// string mode
79
82
mode: ' text/javascript'
80
83
@@ -86,7 +89,7 @@ mode: {
86
89
```
87
90
88
91
``` html
89
- # component config example 2
92
+ <!-- component config example 2 -->
90
93
<codemirror :code.sync =" css" :options =" { tabSize: 2, mode: 'css' }" ></codemirror >
91
94
```
92
95
You can’t perform that action at this time.
0 commit comments