vue-codemirror6 1.6.2 → 1.7.0
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.ja.md +6 -5
- package/README.md +24 -9
- package/dist/index.d.ts +381 -640
- package/dist/index.es.js +361 -354
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/package.json +72 -64
package/README.ja.md
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
<img src="https://user-images.githubusercontent.com/480173/224358008-6ffad05d-1d97-4c18-8554-7d41b03f88ab.png" alt="logo" width="300" height="300" />
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
10
|
+
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
11
|
+
[](https://www.jsdelivr.com/package/npm/vue-codemirror6)
|
|
12
12
|
[](https://uiwjs.github.io/npm-unpkg/#/pkg/@logue/vue-codemirror6/file/README.md)
|
|
13
|
-
[](https://gitpod.io/#https://github.com/logue
|
|
13
|
+
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
14
14
|
[](https://x.com/logue256)
|
|
15
15
|
[](https://github.com/sponsors/logue)
|
|
16
16
|
|
|
@@ -182,7 +182,8 @@ export default defineComponent({
|
|
|
182
182
|
<pre>
|
|
183
183
|
{
|
|
184
184
|
"key": "value"
|
|
185
|
-
}</pre
|
|
185
|
+
}</pre
|
|
186
|
+
>
|
|
186
187
|
</code-mirror>
|
|
187
188
|
</template>
|
|
188
189
|
|
package/README.md
CHANGED
|
@@ -6,12 +6,12 @@ English | [日本語](README.ja.md)
|
|
|
6
6
|
<img src="https://user-images.githubusercontent.com/480173/224358008-6ffad05d-1d97-4c18-8554-7d41b03f88ab.png" alt="logo" width="300" height="300" />
|
|
7
7
|
</p>
|
|
8
8
|
|
|
9
|
-
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
10
|
+
[](https://www.npmjs.com/package/vue-codemirror6)
|
|
11
|
+
[](https://www.jsdelivr.com/package/npm/vue-codemirror6)
|
|
12
12
|
[](https://uiwjs.github.io/npm-unpkg/#/pkg/@logue/vue-codemirror6/file/README.md)
|
|
13
|
-
[](https://gitpod.io/#https://github.com/logue
|
|
14
|
-
[](https://
|
|
13
|
+
[](https://gitpod.io/#https://github.com/logue/vue-codemirror6)
|
|
14
|
+
[](https://x.com/logue256)
|
|
15
15
|
[](https://github.com/sponsors/logue)
|
|
16
16
|
|
|
17
17
|
A component for using [CodeMirror6](https://codemirror.net/6/) with Vue. This component works in both Vue2 and Vue3.
|
|
@@ -181,7 +181,8 @@ Also, insert a `<pre>` tag to prevent the text in the slot from being automatica
|
|
|
181
181
|
<pre>
|
|
182
182
|
{
|
|
183
183
|
"key": "value"
|
|
184
|
-
}</pre
|
|
184
|
+
}</pre
|
|
185
|
+
>
|
|
185
186
|
</code-mirror>
|
|
186
187
|
</template>
|
|
187
188
|
|
|
@@ -216,7 +217,7 @@ If you're using Nuxt 3, you can use the component directly:
|
|
|
216
217
|
<code-mirror v-model="value" :lang="lang" />
|
|
217
218
|
</template>
|
|
218
219
|
|
|
219
|
-
<script
|
|
220
|
+
<script lang="ts" setup vapor>
|
|
220
221
|
import { ref } from "vue";
|
|
221
222
|
import CodeMirror from "vue-codemirror6";
|
|
222
223
|
import { javascript } from "@codemirror/lang-javascript";
|
|
@@ -241,7 +242,7 @@ For Nuxt 2 or if you encounter any issues, you can wrap the component with `<Cli
|
|
|
241
242
|
When using as a Markdown editor on [vite-vue3-ts-starter](https://github.com/logue/vite-vue3-ts-starter).
|
|
242
243
|
|
|
243
244
|
```vue
|
|
244
|
-
<script lang="ts" setup>
|
|
245
|
+
<script lang="ts" setup vapor>
|
|
245
246
|
import { ref, defineComponent, type Ref } from "vue";
|
|
246
247
|
|
|
247
248
|
// Load component
|
|
@@ -337,7 +338,7 @@ const phrases: Record<string, string> = {
|
|
|
337
338
|
## Parameter / Function
|
|
338
339
|
|
|
339
340
|
```vue
|
|
340
|
-
<script
|
|
341
|
+
<script lang="ts" setup vapor>
|
|
341
342
|
import { ref, onMounted, type Ref, type PropType } from "vue";
|
|
342
343
|
import CodeMirror from "vue-codemirror6";
|
|
343
344
|
|
|
@@ -384,6 +385,20 @@ Since the above method is usually sufficient, its **active use is not recommende
|
|
|
384
385
|
| setSelections(ranges: readonly SelectionRange[], primary?: number) | Sets a new set of selections. |
|
|
385
386
|
| extendSelectionsBy(f: Function) | Applies the given function to all existing selections, and calls extendSelections on the result. |
|
|
386
387
|
|
|
388
|
+
## WebComponents Feature (Experimental)
|
|
389
|
+
|
|
390
|
+
By importing it with CodeMirror, it can also be used as a Web Component.
|
|
391
|
+
|
|
392
|
+
```js
|
|
393
|
+
import { CodeMirror } from "vue-codemirror6";
|
|
394
|
+
|
|
395
|
+
customElements.define("code-mirror", CodeMirror);
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
```html
|
|
399
|
+
<code-mirror></code-mirror>
|
|
400
|
+
```
|
|
401
|
+
|
|
387
402
|
## Recommendations
|
|
388
403
|
|
|
389
404
|
Since CodeMirror has a relatively large capacity, when using [vite](https://vitejs.dev), it is recommended to set it to output as a separate file using the [`manualChunks`](https://vitejs.dev/guide/build.html#chunking-strategy) option at build time as shown below.
|