Skip to content

Commit 8a67591

Browse files
committed
docs: add section—Differences between svelte-jsoneditor and json-editor-vue
1 parent 75c5bac commit 8a67591

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,15 @@ export default {
515515
| mode | edit mode, <br>use `v-model:mode` in Vue 3 <br>or `:mode.sync` in Vue 2 | `'tree'`, `'text'` | `'tree'` |
516516
| ... | properties of [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) | | |
517517

518+
### Binding value difference between `svelte-jsoneditor` and `json-editor-vue`
519+
520+
- `svelte-jsoneditor` An object contains a stringified JSON or a parsed JSON, will do `JSON.parse` when passing as a stringified JSON.
521+
- `json-editor-vue` JSON itself. What users see is what users get.
522+
523+
> Check https://github.com/josdejong/svelte-jsoneditor/pull/166 for more details.
524+
525+
### Boolean properties
526+
518527
Including the boolean properties of `svelte-jsoneditor` like `readOnly` with no value will imply `true`:
519528

520529
- ✔️ `<JsonEditorVue readOnly />`
@@ -558,16 +567,6 @@ import JsonEditorVue from 'json-editor-vue'
558567

559568
<br>
560569

561-
## Differences between `svelte-jsoneditor` and `json-editor-vue`
562-
563-
| | `svelte-jsoneditor` | `json-editor-vue` |
564-
| ------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------ |
565-
| Binding value | An object contains a stringified JSON or a parsed JSON, will do `JSON.parse` when passing as a stringified JSON. | JSON itself. What users see is what users pass. |
566-
567-
Check https://github.com/josdejong/svelte-jsoneditor/pull/166 for more details.
568-
569-
<br>
570-
571570
## Changelog
572571

573572
Detailed changes for each release are documented in the [release notes](https://github.com/cloydlau/json-editor-vue/releases).

docs/README.zh-CN.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,15 @@ export default {
513513
| mode | 编辑模式,<br>在 Vue 3 中使用 `v-model:mode`,<br>在 Vue 2 中使用 `:mode.sync` | `'tree'`, `'text'` | `'tree'` |
514514
| ... | [svelte-jsoneditor](https://github.com/josdejong/svelte-jsoneditor/#properties) 的参数(通过 attrs) | | |
515515

516+
### `svelte-jsoneditor``json-editor-vue` 中绑定值的差异
517+
518+
- `svelte-jsoneditor` 一个包含「stringified JSON」或「parsed JSON」的对象,当作为「stringified JSON」传入时,会经过 `JSON.parse` 解析。
519+
- `json-editor-vue` JSON 本身,所见即所得。
520+
521+
> 详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166.
522+
523+
### 布尔类型参数
524+
516525
仅写上 `svelte-jsoneditor` 的布尔类型参数如 `readOnly` 但不传值,会隐式转换为 `true`
517526

518527
- ✔️ `<JsonEditorVue readOnly />`
@@ -556,16 +565,6 @@ import JsonEditorVue from 'json-editor-vue'
556565

557566
<br>
558567

559-
## `svelte-jsoneditor``json-editor-vue` 的差异
560-
561-
| | `svelte-jsoneditor` | `json-editor-vue` |
562-
| ------ | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- |
563-
| 绑定值 | 一个包含「stringified JSON」或「parsed JSON」的对象,当作为「stringified JSON」传入时,会经过 `JSON.parse` 解析。 | JSON 本身。用户传什么参数编辑器就展示什么数据。 |
564-
565-
详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166.
566-
567-
<br>
568-
569568
## 更新日志
570569

571570
各版本详细改动请参考 [release notes](https://github.com/cloydlau/json-editor-vue/releases)

0 commit comments

Comments
 (0)