@@ -30,6 +30,7 @@ English | [简体中文](./docs/README.zh-CN.md)
3030
3131- Support Vue 2.6 / 2.7 / 3
3232- Support SSR (Nuxt 2 / 3)
33+ - Support Vite, Vue CLI 3 / 4 / 5 ...
3334- Support microfrontends (like [ wujie] ( https://github.com/Tencent/wujie ) )
3435- Edit mode two-way binding
3536- 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
502503export default {
503504 build: {
504505 extend(config ) {
506+ // Getting webpack to recognize the `.mjs` file
505507 config .module .rules .push ({
506508 test: / \. mjs$ / ,
507509 include: / node_modules/ ,
@@ -539,6 +541,7 @@ export default {
539541 plugins: [' ~/plugins/JsonEditorVue.client' ],
540542 build: {
541543 extend(config ) {
544+ // Getting webpack to recognize the `.mjs` file
542545 config .module .rules .push ({
543546 test: / \. mjs$ / ,
544547 include: / node_modules/ ,
@@ -590,6 +593,7 @@ npm add json-editor-vue vanilla-jsoneditor @vue/composition-api
590593export default {
591594 build: {
592595 extend(config ) {
596+ // Getting webpack to recognize the `.mjs` file
593597 config .module .rules .push ({
594598 test: / \. mjs$ / ,
595599 include: / node_modules/ ,
@@ -636,6 +640,7 @@ export default {
636640 plugins: [' ~/plugins/JsonEditorVue.client' ],
637641 build: {
638642 extend(config ) {
643+ // Getting webpack to recognize the `.mjs` file
639644 config .module .rules .push ({
640645 test: / \. mjs$ / ,
641646 include: / node_modules/ ,
@@ -685,19 +690,58 @@ Ready to use right out of the box.
685690
686691<br >
687692
688- ### Vue CLI 5 / webpack 5
693+ ### Vue CLI 5 ( webpack 5)
689694
690695Ready to use right out of the box.
691696
692697<br >
693698
694- ### Vue CLI 4 / webpack 4
699+ ### Vue CLI 4 ( webpack 4)
695700
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.
697702
698703``` 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+
699735module .exports = {
700736 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+ },
701745}
702746```
703747
@@ -708,7 +752,7 @@ module.exports = {
708752| Name | Description | Type | Default |
709753| ------- | --------------------------------------------------------------------------------------------- | ------------- | -------- |
710754| 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' ` |
712756| ... | properties of [ svelte-jsoneditor] ( https://github.com/josdejong/svelte-jsoneditor/#properties ) | | |
713757
714758> ⚠ kebab-case is required for tag & prop name when using from CDN
0 commit comments