Skip to content

Commit e2d3cc9

Browse files
committed
docs: add example for users who prefer the binding value behavior of svelte-jsoneditor
1 parent 5d775df commit e2d3cc9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,16 @@ export default {
520520
- `svelte-jsoneditor` An object contains a stringified JSON or a parsed JSON, will do `JSON.parse` when passing as a stringified JSON.
521521
- `json-editor-vue` JSON itself. What users see is what users get.
522522

523+
If you prefer the behavior of `svelte-jsoneditor`:
524+
525+
```html
526+
<JsonEditorVue
527+
:content="content" :onChange="updatedContent => {
528+
content = updatedContent
529+
}"
530+
/>
531+
```
532+
523533
> Check https://github.com/josdejong/svelte-jsoneditor/pull/166 for more details.
524534
525535
### Boolean properties

docs/README.zh-CN.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,16 @@ export default {
518518
- `svelte-jsoneditor` 一个包含「stringified JSON」或「parsed JSON」的对象,当作为「stringified JSON」传入时,会经过 `JSON.parse` 解析。
519519
- `json-editor-vue` JSON 本身,所见即所得。
520520

521+
如果你更倾向于 `svelte-jsoneditor` 的行为:
522+
523+
```html
524+
<JsonEditorVue
525+
:content="content" :onChange="updatedContent => {
526+
content = updatedContent
527+
}"
528+
/>
529+
```
530+
521531
> 详情见 https://github.com/josdejong/svelte-jsoneditor/pull/166.
522532
523533
### 布尔类型参数

0 commit comments

Comments
 (0)