Skip to content

Commit 8e136e2

Browse files
committed
docs: typo
1 parent c3d7f5d commit 8e136e2

File tree

3 files changed

+62
-18
lines changed

3 files changed

+62
-18
lines changed

README.md

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ English | [简体中文](./docs/README.zh-CN.md)
3030

3131
- Support Vue 2.6 / 2.7 / 3
3232
- Support SSR (Nuxt 2 / 3)
33+
- Support microfrontends ([wujie](https://github.com/Tencent/wujie), [qiankun](https://github.com/umijs/qiankun), [single-spa](https://github.com/single-spa/single-spa) ...)
3334
- Support Vite, Vue CLI 3 / 4 / 5, CDN ...
34-
- Support microfrontends (like [wujie](https://github.com/Tencent/wujie))
3535
- Edit mode two-way binding
3636
- Local registration + local configuration, or global registration + global configuration (Powered by [vue-global-config](https://github.com/cloydlau/vue-global-config))
3737

@@ -293,7 +293,7 @@ Vue.use(VCA)
293293
294294
export default {
295295
components: { JsonEditorVue },
296-
date() {
296+
data() {
297297
return {
298298
value: undefined,
299299
}
@@ -708,6 +708,27 @@ module.exports = {
708708
}
709709
```
710710

711+
⚠ Only for version ≤ 4.5.14:
712+
713+
```js
714+
// vue.config.js
715+
716+
module.exports = {
717+
configureWebpack: {
718+
module: {
719+
rules: [
720+
// Getting webpack to recognize the `.mjs` file
721+
{
722+
test: /\.mjs$/,
723+
include: /node_modules/,
724+
type: 'javascript/auto',
725+
},
726+
],
727+
},
728+
},
729+
}
730+
```
731+
711732
<br>
712733

713734
### Vue CLI 3 (webpack 4)
@@ -760,7 +781,7 @@ module.exports = {
760781
### Binding value difference between svelte-jsoneditor and json-editor-vue
761782

762783
- svelte-jsoneditor: An object contains a stringified JSON or a parsed JSON, will do `JSON.parse` when passing as a stringified JSON.
763-
- json-editor-vue: JSON itself. What users see is what users get.
784+
- json-editor-vue: JSON itself. What user see is what user get.
764785

765786
If you prefer the behavior of svelte-jsoneditor:
766787

demo/vue-cli3/vue.config.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
module.exports = {
2-
/* configureWebpack: {
3-
module: {
4-
rules: [
5-
{
6-
test: /\.mjs$/,
7-
include: /node_modules/,
8-
type: 'javascript/auto',
9-
},
10-
],
11-
},
12-
}, */
13-
chainWebpack(config) {
2+
// Vue CLI 3 ~ 4.5.14 可用
3+
configureWebpack: {
4+
module: {
5+
rules: [
6+
{
7+
test: /\.mjs$/,
8+
include: /node_modules/,
9+
type: 'javascript/auto',
10+
},
11+
],
12+
},
13+
},
14+
// 仅 Vue CLI 3 可用
15+
/* chainWebpack(config) {
1416
// config.resolve.extensions.prepend('.mjs')
1517
config.module
1618
.rule('mjs')
1719
// .test(/\.mjs$/)
1820
.include.add(/node_modules/)
1921
.type('javascript/auto')
2022
.end()
21-
},
23+
}, */
2224
transpileDependencies: ['json-editor-vue'],
2325
}

docs/README.zh-CN.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828

2929
- Vue 2.6 / 2.7 / 3 通用
3030
- 支持 SSR,Nuxt 2 / 3 通用
31+
- 支持微前端 ([wujie](https://github.com/Tencent/wujie), [qiankun](https://github.com/umijs/qiankun), [single-spa](https://github.com/single-spa/single-spa) ...)
3132
- 支持 Vite,Vue CLI 3 / 4 / 5, CDN ...
32-
- 支持微前端 (比如 [wujie](https://github.com/Tencent/wujie))
3333
- 编辑模式双向绑定
3434
- 局部注册 + 局部传参,也可以全局注册 + 全局传参 ([vue-global-config](https://github.com/cloydlau/vue-global-config) 提供技术支持)
3535

@@ -291,7 +291,7 @@ Vue.use(VCA)
291291
292292
export default {
293293
components: { JsonEditorVue },
294-
date() {
294+
data() {
295295
return {
296296
value: undefined,
297297
}
@@ -706,6 +706,27 @@ module.exports = {
706706
}
707707
```
708708

709+
⚠ 仅 ≤ 4.5.14 版本需要:
710+
711+
```js
712+
// vue.config.js
713+
714+
module.exports = {
715+
configureWebpack: {
716+
module: {
717+
rules: [
718+
// 让 webpack 识别 `.mjs` 文件
719+
{
720+
test: /\.mjs$/,
721+
include: /node_modules/,
722+
type: 'javascript/auto',
723+
},
724+
],
725+
},
726+
},
727+
}
728+
```
729+
709730
<br>
710731

711732
### Vue CLI 3 (webpack 4)

0 commit comments

Comments
 (0)