vue-codemirror6 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -5
- package/dist/vue-codemirror6.es.js +5426 -900
- package/dist/vue-codemirror6.umd.js +28 -1
- package/package.json +35 -28
- package/src/components/CodeMirror.vue +87 -26
- package/dist/components/CodeMirror.vue.d.ts +0 -37
- package/dist/components/CodeMirror.vue.d.ts.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.esm.d.ts +0 -6
- package/dist/index.esm.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -4,6 +4,20 @@ A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. Unlike
|
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
7
|
+
This component can handle bidirectional binding by `v-model` like a general Vue component.
|
|
8
|
+
|
|
9
|
+
Other options are currently as follows:
|
|
10
|
+
|
|
11
|
+
| attribute | information |
|
|
12
|
+
| ---------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
|
13
|
+
| lang | The language you want to have syntax highlighting. see <https://codemirror.net/6/#languages> |
|
|
14
|
+
| phrases | Specify here if you want to make the displayed character string multilingual. see <https://codemirror.net/6/examples/translate/> |
|
|
15
|
+
| extensions | Includes enhancements to extend CodeMirror. Such as [@codemirror/basic-setup](https://github.com/codemirror/basic-setup). |
|
|
16
|
+
| dark | Toggle Darkmode. |
|
|
17
|
+
| linter | Set Linter. see example <https://codesandbox.io/s/f6nb0?file=/src/index.js> |
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
7
21
|
When using as a Markdown editor on [Vuetify](https://vuetifyjs.com/).
|
|
8
22
|
|
|
9
23
|
```vue
|
|
@@ -39,14 +53,14 @@ export default class Home extends Vue {
|
|
|
39
53
|
/**
|
|
40
54
|
* CodeMirror Language
|
|
41
55
|
*
|
|
42
|
-
* @see {@link https://codemirror.net/6/docs/ref/#language
|
|
56
|
+
* @see {@link https://codemirror.net/6/docs/ref/#language | @codemirror/language}
|
|
43
57
|
*/
|
|
44
58
|
lang: LanguageSupport = markdown();
|
|
45
59
|
|
|
46
60
|
/**
|
|
47
|
-
* Internationalization Config
|
|
61
|
+
* Internationalization Config. In this example, the display language is Japanese.
|
|
48
62
|
*
|
|
49
|
-
* @see {@link https://codemirror.net/6/examples/translate
|
|
63
|
+
* @see {@link https://codemirror.net/6/examples/translate/ | Example: Internationalization}
|
|
50
64
|
*/
|
|
51
65
|
phrases: Record<string, string> = {
|
|
52
66
|
// @codemirror/view
|
|
@@ -82,10 +96,10 @@ export default class Home extends Vue {
|
|
|
82
96
|
/**
|
|
83
97
|
* CodeMirror Extensions
|
|
84
98
|
*
|
|
85
|
-
* @see {@link:https://codemirror.net/6/docs/ref/#state.Extension|Extending Editor State}
|
|
99
|
+
* @see {@link:https://codemirror.net/6/docs/ref/#state.Extension | Extending Editor State}
|
|
86
100
|
*/
|
|
87
101
|
extensions: Extension[] = [
|
|
88
|
-
/** @see {@link:https://codemirror.net/6/docs/ref/#basic-setup|basic-setup} */
|
|
102
|
+
/** @see {@link:https://codemirror.net/6/docs/ref/#basic-setup | basic-setup} */
|
|
89
103
|
basicSetup
|
|
90
104
|
]
|
|
91
105
|
|