@@ -30,6 +30,7 @@ English | [简体中文](./docs/README.zh-CN.md)
30
30
31
31
- Support Vue 2.6 / 2.7 / 3
32
32
- Support SSR (Nuxt 2 / 3)
33
+ - Support Vite, Vue CLI 3 / 4 / 5 ...
33
34
- Support microfrontends (like [ wujie] ( https://github.com/Tencent/wujie ) )
34
35
- Edit mode two-way binding
35
36
- Local registration + local configuration, or global registration + global configuration (Powered by [ vue-global-config] ( https://github.com/cloydlau/vue-global-config ) )
@@ -502,6 +503,7 @@ npm add json-editor-vue vanilla-jsoneditor
502
503
export default {
503
504
build: {
504
505
extend(config ) {
506
+ // Getting webpack to recognize the `.mjs` file
505
507
config .module .rules .push ({
506
508
test: / \. mjs$ / ,
507
509
include: / node_modules/ ,
@@ -539,6 +541,7 @@ export default {
539
541
plugins: [' ~/plugins/JsonEditorVue.client' ],
540
542
build: {
541
543
extend(config ) {
544
+ // Getting webpack to recognize the `.mjs` file
542
545
config .module .rules .push ({
543
546
test: / \. mjs$ / ,
544
547
include: / node_modules/ ,
@@ -590,6 +593,7 @@ npm add json-editor-vue vanilla-jsoneditor @vue/composition-api
590
593
export default {
591
594
build: {
592
595
extend(config ) {
596
+ // Getting webpack to recognize the `.mjs` file
593
597
config .module .rules .push ({
594
598
test: / \. mjs$ / ,
595
599
include: / node_modules/ ,
@@ -636,6 +640,7 @@ export default {
636
640
plugins: [' ~/plugins/JsonEditorVue.client' ],
637
641
build: {
638
642
extend(config ) {
643
+ // Getting webpack to recognize the `.mjs` file
639
644
config .module .rules .push ({
640
645
test: / \. mjs$ / ,
641
646
include: / node_modules/ ,
@@ -685,19 +690,58 @@ Ready to use right out of the box.
685
690
686
691
<br >
687
692
688
- ### Vue CLI 5 / webpack 5
693
+ ### Vue CLI 5 ( webpack 5)
689
694
690
695
Ready to use right out of the box.
691
696
692
697
<br >
693
698
694
- ### Vue CLI 4 / webpack 4
699
+ ### Vue CLI 4 ( webpack 4)
695
700
696
- Vite 4 (Rollup 3) uses ES2020 as compiler target by default, therefore Vite-4-built outputs should be transpiled in webpack 4:
701
+ Vite 4 (Rollup 3) uses ES2020 as compiler target by default, therefore Vite-4-built outputs should be transpiled in webpack 4.
697
702
698
703
``` js
704
+ // vue.config.js
705
+
706
+ module .exports = {
707
+ transpileDependencies: [' json-editor-vue' ],
708
+ }
709
+ ```
710
+
711
+ <br >
712
+
713
+ ### Vue CLI 3 (webpack 4)
714
+
715
+ Vite 4 (Rollup 3) uses ES2020 as compiler target by default, therefore Vite-4-built outputs should be transpiled in webpack 4.
716
+
717
+ ``` shell
718
+ npm add @babel/plugin-proposal-nullish-coalescing-operator @babel/plugin-proposal-optional-chaining -D
719
+ ```
720
+
721
+ ``` js
722
+ // babel.config.js
723
+
724
+ module .exports = {
725
+ plugins: [
726
+ ' @babel/plugin-proposal-nullish-coalescing-operator' ,
727
+ ' @babel/plugin-proposal-optional-chaining' ,
728
+ ],
729
+ }
730
+ ```
731
+
732
+ ``` js
733
+ // vue.config.js
734
+
699
735
module .exports = {
700
736
transpileDependencies: [' json-editor-vue' ],
737
+ chainWebpack (config ) {
738
+ // Getting webpack to recognize the `.mjs` file
739
+ config .module
740
+ .rule (' mjs' )
741
+ .type (' javascript/auto' )
742
+ .include .add (/ node_modules/ )
743
+ .end ()
744
+ },
701
745
}
702
746
```
703
747
@@ -708,7 +752,7 @@ module.exports = {
708
752
| Name | Description | Type | Default |
709
753
| ------- | --------------------------------------------------------------------------------------------- | ------------- | -------- |
710
754
| v-model | binding value | ` any ` | |
711
- | mode | edit mode, <br >use ` v-model:mode ` in Vue 3 <br >or ` :mode.sync ` in Vue 2 | [ Mode] ( #Mode ) | ` 'tree' ` |
755
+ | mode | edit mode, <br >use ` [ v-model] :mode` in Vue 3 <br >or ` :mode[ .sync] ` in Vue 2 | [ Mode] ( #Mode ) | ` 'tree' ` |
712
756
| ... | properties of [ svelte-jsoneditor] ( https://github.com/josdejong/svelte-jsoneditor/#properties ) | | |
713
757
714
758
> ⚠ kebab-case is required for tag & prop name when using from CDN
0 commit comments